Changeset 50761 for trunk/src/wp-includes/blocks.php
- Timestamp:
- 04/15/2021 02:41:38 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/blocks.php
r50531 r50761 909 909 return WP_Block_Styles_Registry::get_instance()->unregister( $block_name, $block_style_name ); 910 910 } 911 912 /** 913 * Checks whether the current block type supports the feature requested. 914 * 915 * @since 5.8.0 916 * 917 * @param WP_Block_Type $block_type Block type to check for support. 918 * @param string $feature Name of the feature to check support for. 919 * @param mixed $default Fallback value for feature support, defaults to false. 920 * 921 * @return boolean Whether or not the feature is supported. 922 */ 923 function block_has_support( $block_type, $feature, $default = false ) { 924 $block_support = $default; 925 if ( $block_type && property_exists( $block_type, 'supports' ) ) { 926 $block_support = _wp_array_get( $block_type->supports, $feature, $default ); 927 } 928 929 return true === $block_support || is_array( $block_support ); 930 }
Note: See TracChangeset
for help on using the changeset viewer.