Changeset 10065 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-block-validator.php
- Timestamp:
- 07/13/2020 07:40:02 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-block-validator.php
r10059 r10065 192 192 foreach ( $results_by_type[ $type ] as $item ) { 193 193 // Only get details if this is a warning or error. 194 $details = ( 'info' === $type ) ? false : self::get_detailed_help( $item->check_name );194 $details = ( 'info' === $type ) ? false : self::get_detailed_help( $item->check_name, $item ); 195 195 if ( $details ) { 196 196 $details = '<p>' . implode( '</p><p>', (array) $details ) . '</p>'; … … 226 226 * 227 227 * @param string $method The name of the check method. 228 * @param array $result The full result data. 228 229 * 229 230 * @return string|array More details for a given block issue. Array of strings if there should be a linebreak. 230 231 */ 231 public static function get_detailed_help( $method ) {232 public static function get_detailed_help( $method, $result ) { 232 233 switch ( $method ) { 233 234 // These don't need more details. … … 242 243 return __( 'The readme.txt file must contain the tag "block" (singular) for this to be added to the block directory.', 'wporg-plugins' ); 243 244 case 'check_for_duplicate_block_name': 244 return[245 $details = [ 245 246 __( "Block names must be unique, otherwise it can cause problems when using the block. It is recommended to use your plugin's name as the namespace.", 'wporg-plugins' ), 246 '<em>' . __( 'If this is a different version of your own plugin, you can ignore this warning.', 'wporg-plugins' ) . '</em>',247 247 ]; 248 if ( 'warning' === $result->type ) { 249 $details[] = '<em>' . __( 'If this is a different version of your own plugin, you can ignore this warning.', 'wporg-plugins' ) . '</em>'; 250 } 251 return $details; 248 252 case 'check_for_blocks': 249 253 return [
Note: See TracChangeset
for help on using the changeset viewer.