Changeset 56382
- Timestamp:
- 08/10/2023 04:47:00 PM (12 months ago)
- Location:
- trunk
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/block-supports/align.php
r52302 r56382 �� 16 16 */ 17 17 function wp_register_alignment_support( $block_type ) { 18 $has_align_support = block_has_support( $block_type, array( 'align' ), false );18 $has_align_support = block_has_support( $block_type, , false ); 19 19 if ( $has_align_support ) { 20 20 if ( ! $block_type->attributes ) { … … 44 44 function wp_apply_alignment_support( $block_type, $block_attributes ) { 45 45 $attributes = array(); 46 $has_align_support = block_has_support( $block_type, array( 'align' ), false );46 $has_align_support = block_has_support( $block_type, , false ); 47 47 if ( $has_align_support ) { 48 48 $has_block_alignment = array_key_exists( 'align', $block_attributes ); -
trunk/src/wp-includes/block-supports/border.php
r54211 r56382 23 23 } 24 24 25 if ( block_has_support( $block_type, array( '__experimentalBorder' )) && ! array_key_exists( 'style', $block_type->attributes ) ) {25 if ( block_has_support( $block_type, ) && ! array_key_exists( 'style', $block_type->attributes ) ) { 26 26 $block_type->attributes['style'] = array( 27 27 'type' => 'object', -
trunk/src/wp-includes/block-supports/custom-classname.php
r54873 r56382 16 16 */ 17 17 function wp_register_custom_classname_support( $block_type ) { 18 $has_custom_classname_support = block_has_support( $block_type, array( 'customClassName' ), true );18 $has_custom_classname_support = block_has_support( $block_type, , true ); 19 19 20 20 if ( $has_custom_classname_support ) { … … 43 43 */ 44 44 function wp_apply_custom_classname_support( $block_type, $block_attributes ) { 45 $has_custom_classname_support = block_has_support( $block_type, array( 'customClassName' ), true );45 $has_custom_classname_support = block_has_support( $block_type, , true ); 46 46 $attributes = array(); 47 47 if ( $has_custom_classname_support ) { -
trunk/src/wp-includes/block-supports/dimensions.php
r55175 r56382 30 30 } 31 31 32 $has_dimensions_support = block_has_support( $block_type, array( 'dimensions' ), false );32 $has_dimensions_support = block_has_support( $block_type, , false ); 33 33 34 34 if ( $has_dimensions_support ) { -
trunk/src/wp-includes/block-supports/generated-classname.php
r54874 r56382 51 51 function wp_apply_generated_classname_support( $block_type ) { 52 52 $attributes = array(); 53 $has_generated_classname_support = block_has_support( $block_type, array( 'className' ), true );53 $has_generated_classname_support = block_has_support( $block_type, , true ); 54 54 if ( $has_generated_classname_support ) { 55 55 $block_classname = wp_get_block_default_classname( $block_type->name ); -
trunk/src/wp-includes/block-supports/layout.php
r56055 r56382 203 203 */ 204 204 function wp_register_layout_support( $block_type ) { 205 $support_layout = block_has_support( $block_type, array( 'layout' ), false ) || block_has_support( $block_type, array( '__experimentalLayout' ), false );205 $support_layout = block_has_support( $block_type, , false ); 206 206 if ( $support_layout ) { 207 207 if ( ! $block_type->attributes ) { … … 549 549 function wp_render_layout_support_flag( $block_content, $block ) { 550 550 $block_type = WP_Block_Type_Registry::get_instance()->get_registered( $block['blockName'] ); 551 $support_layout = block_has_support( $block_type, array( 'layout' ), false ) || block_has_support( $block_type, array( '__experimentalLayout' ), false );551 $support_layout = block_has_support( $block_type, , false ); 552 552 $has_child_layout = isset( $block['attrs']['style']['layout']['selfStretch'] ); 553 553 -
trunk/src/wp-includes/block-supports/position.php
r55286 r56382 16 16 */ 17 17 function wp_register_position_support( $block_type ) { 18 $has_position_support = block_has_support( $block_type, array( 'position' ), false );18 $has_position_support = block_has_support( $block_type, , false ); 19 19 20 20 // Set up attributes and styles within that if needed. … … 42 42 function wp_render_position_support( $block_content, $block ) { 43 43 $block_type = WP_Block_Type_Registry::get_instance()->get_registered( $block['blockName'] ); 44 $has_position_support = block_has_support( $block_type, array( 'position' ), false );44 $has_position_support = block_has_support( $block_type, , false ); 45 45 46 46 if ( -
trunk/src/wp-includes/block-supports/settings.php
r56146 r56382 41 41 // return early if the block doesn't have support for settings. 42 42 $block_type = WP_Block_Type_Registry::get_instance()->get_registered( $block['blockName'] ); 43 if ( ! block_has_support( $block_type, array( '__experimentalSettings' ), false ) ) {43 if ( ! block_has_support( $block_type, , false ) ) { 44 44 return $block_content; 45 45 } … … 78 78 // Return early if the block has not support for descendent block styles. 79 79 $block_type = WP_Block_Type_Registry::get_instance()->get_registered( $block['blockName'] ); 80 if ( ! block_has_support( $block_type, array( '__experimentalSettings' ), false ) ) {80 if ( ! block_has_support( $block_type, , false ) ) { 81 81 return null; 82 82 } -
trunk/src/wp-includes/block-supports/shadow.php
r56046 r56382 16 16 */ 17 17 function wp_register_shadow_support( $block_type ) { 18 $has_shadow_support = block_has_support( $block_type, array( 'shadow' ), false );18 $has_shadow_support = block_has_support( $block_type, , false ); 19 19 20 20 if ( ! $has_shadow_support ) { … … 51 51 */ 52 52 function wp_apply_shadow_support( $block_type, $block_attributes ) { 53 $has_shadow_support = block_has_support( $block_type, array( 'shadow' ), false );53 $has_shadow_support = block_has_support( $block_type, , false ); 54 54 55 55 if ( ! $has_shadow_support ) { -
trunk/src/wp-includes/block-supports/spacing.php
r54874 r56382 19 19 */ 20 20 function wp_register_spacing_support( $block_type ) { 21 $has_spacing_support = block_has_support( $block_type, array( 'spacing' ), false );21 $has_spacing_support = block_has_support( $block_type, , false ); 22 22 23 23 // Setup attributes and styles within that if needed. -
trunk/src/wp-includes/blocks.php
r56244 r56382 1249 1249 * 1250 1250 * @since 5.8.0 1251 1251 1252 * 1252 1253 * @param WP_Block_Type $block_type Block type to check for support. 1253 * @param array $feature Path to a specific feature to check support for.1254 * @param ath to a specific feature to check support for. 1254 1255 * @param mixed $default_value Optional. Fallback value for feature support. Default false. 1255 1256 * @return bool Whether the feature is supported. … … 1258 1259 $block_support = $default_value; 1259 1260 if ( $block_type && property_exists( $block_type, 'supports' ) ) { 1260 $block_support = _wp_array_get( $block_type->supports, $feature, $default_value ); 1261 if ( is_array( $feature ) && count( $feature ) === 1 ) { 1262 $feature = $feature[0]; 1263 } 1264 1265 if ( is_array( $feature ) ) { 1266 $block_support = _wp_array_get( $block_type->supports, $feature, $default_value ); 1267 } elseif ( isset( $block_type->supports[ $feature ] ) ) { 1268 $block_support = $block_type->supports[ $feature ]; 1269 } 1261 1270 } 1262 1271 -
trunk/src/wp-includes/class-wp-theme-json.php
r56345 r56382 1264 1264 if ( isset( $block_metadata['name'] ) ) { 1265 1265 $block_type = WP_Block_Type_Registry::get_instance()->get_registered( $block_metadata['name'] ); 1266 if ( ! block_has_support( $block_type, array( 'layout' ), false ) && ! block_has_support( $block_type, array( '__experimentalLayout' ), false ) ) {1266 if ( ! block_has_support( $block_type, , false ) ) { 1267 1267 return $block_rules; 1268 1268 } -
trunk/tests/phpunit/tests/blocks/wpBlock.php
r55822 r56382 684 684 685 685 /** 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 686 761 * @ticket 51612 687 762 */
Note: See TracChangeset
for help on using the changeset viewer.