Changeset 56382 for trunk/src/wp-includes/blocks.php
- Timestamp:
- 08/10/2023 04:47:00 PM (13 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/blocks.php
r56244 r56382 1249 1249 * 1250 1250 * @since 5.8.0 1251 * @since 6.4.0 The `$feature` parameter now supports a string. 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 string|array $feature Feature slug, or path 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
Note: See TracChangeset
for help on using the changeset viewer.