- Timestamp:
- 04/15/2021 02:41:38 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/block-supports/custom-classname.php
r49580 r50761 4 4 * 5 5 * @package WordPress 6 * @since 5.6.0 6 7 */ 7 8 … … 9 10 * Registers the custom classname block attribute for block types that support it. 10 11 * 12 * @since 5.6.0 11 13 * @access private 12 14 * … … 14 16 */ 15 17 function wp_register_custom_classname_support( $block_type ) { 16 $has_custom_classname_support = true; 17 if ( property_exists( $block_type, 'supports' ) ) { 18 $has_custom_classname_support = _wp_array_get( $block_type->supports, array( 'customClassName' ), true ); 19 } 18 $has_custom_classname_support = block_has_support( $block_type, array( 'customClassName' ), true ); 19 20 20 if ( $has_custom_classname_support ) { 21 21 if ( ! $block_type->attributes ) { … … 34 34 * Add the custom classnames to the output. 35 35 * 36 * @since 5.6.0 36 37 * @access private 37 38 * … … 42 43 */ 43 44 function wp_apply_custom_classname_support( $block_type, $block_attributes ) { 44 $has_custom_classname_support = true;45 $has_custom_classname_support = block_has_support( $block_type, array( 'customClassName' ), true ); 45 46 $attributes = array(); 46 if ( property_exists( $block_type, 'supports' ) ) {47 $has_custom_classname_support = _wp_array_get( $block_type->supports, array( 'customClassName' ), true );48 }49 47 if ( $has_custom_classname_support ) { 50 48 $has_custom_classnames = array_key_exists( 'className', $block_attributes );
Note: See TracChangeset
for help on using the changeset viewer.