Make WordPress Core


Ignore:
Timestamp:
04/15/2021 02:41:38 PM (4 years ago)
Author:
gziolo
Message:

Editor: Update WordPress packages to use with WordPress 5.8

In the response to the discussion during the Dev Chat, I'm doing a first pass to keep WordPress packages up to date in the WordPress 5.8 release cycle.

See https://github.com/WordPress/wordpress-develop/pull/1176 for more details.

Props youknowriad, aristath, andraganescu.
See #52991.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/blocks.php

    r50531 r50761  
    909909    return WP_Block_Styles_Registry::get_instance()->unregister( $block_name, $block_style_name );
    910910}
     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 */
     923function 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.