wp_has_border_feature_support

The timeline below displays how wordpress function wp_has_border_feature_support has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.4

/**
 * Checks whether the current block type supports the border feature requested.
 *
 * If the `__experimentalBorder` support flag is a boolean `true` all border
 * support features are available. Otherwise, the specific feature's support
 * flag nested under `experimentalBorder` must be enabled for the feature
 * to be opted into.
 *
 * @since 5.8.0
 * @access private
 *
 * @param WP_Block_Type $block_type    Block type to check for support.
 * @param string        $feature       Name of the feature to check support for.
 * @param mixed         $default_value Fallback value for feature support, defaults to false.
 * @return bool Whether the feature is supported.
 */
function wp_has_border_feature_support($block_type, $feature, $default_value = false)
{
    // Check if all border support features have been opted into via `"__experimentalBorder": true`.
    if ($block_type instanceof WP_Block_Type) {
        $block_type_supports_border = isset($block_type->supports['__experimentalBorder']) ? $block_type->supports['__experimentalBorder'] : $default_value;
        if (true === $block_type_supports_border) {
            return true;
        }
    }
    // Check if the specific feature has been opted into individually
    // via nested flag under `__experimentalBorder`.
    return block_has_support($block_type, array('__experimentalBorder', $feature), $default_value);
}

WordPress Version: 6.1

/**
 * Checks whether the current block type supports the border feature requested.
 *
 * If the `__experimentalBorder` support flag is a boolean `true` all border
 * support features are available. Otherwise, the specific feature's support
 * flag nested under `experimentalBorder` must be enabled for the feature
 * to be opted into.
 *
 * @since 5.8.0
 * @access private
 *
 * @param WP_Block_Type $block_type    Block type to check for support.
 * @param string        $feature       Name of the feature to check support for.
 * @param mixed         $default_value Fallback value for feature support, defaults to false.
 * @return bool Whether the feature is supported.
 */
function wp_has_border_feature_support($block_type, $feature, $default_value = false)
{
    // Check if all border support features have been opted into via `"__experimentalBorder": true`.
    if (property_exists($block_type, 'supports') && true === _wp_array_get($block_type->supports, array('__experimentalBorder'), $default_value)) {
        return true;
    }
    // Check if the specific feature has been opted into individually
    // via nested flag under `__experimentalBorder`.
    return block_has_support($block_type, array('__experimentalBorder', $feature), $default_value);
}

WordPress Version: 5.9

/**
 * Checks whether the current block type supports the border feature requested.
 *
 * If the `__experimentalBorder` support flag is a boolean `true` all border
 * support features are available. Otherwise, the specific feature's support
 * flag nested under `experimentalBorder` must be enabled for the feature
 * to be opted into.
 *
 * @since 5.8.0
 * @access private
 *
 * @param WP_Block_Type $block_type Block type to check for support.
 * @param string        $feature    Name of the feature to check support for.
 * @param mixed         $default    Fallback value for feature support, defaults to false.
 * @return bool Whether the feature is supported.
 */
function wp_has_border_feature_support($block_type, $feature, $default = false)
{
    // Check if all border support features have been opted into via `"__experimentalBorder": true`.
    if (property_exists($block_type, 'supports') && true === _wp_array_get($block_type->supports, array('__experimentalBorder'), $default)) {
        return true;
    }
    // Check if the specific feature has been opted into individually
    // via nested flag under `__experimentalBorder`.
    return block_has_support($block_type, array('__experimentalBorder', $feature), $default);
}

WordPress Version: 5.8

/**
 * Checks whether the current block type supports the border feature requested.
 *
 * If the `__experimentalBorder` support flag is a boolean `true` all border
 * support features are available. Otherwise, the specific feature's support
 * flag nested under `experimentalBorder` must be enabled for the feature
 * to be opted into.
 *
 * @since 5.8.0
 * @access private
 *
 * @param WP_Block_Type $block_type Block type to check for support.
 * @param string        $feature    Name of the feature to check support for.
 * @param mixed         $default    Fallback value for feature support, defaults to false.
 *
 * @return boolean Whether or not the feature is supported.
 */
function wp_has_border_feature_support($block_type, $feature, $default = false)
{
    // Check if all border support features have been opted into via `"__experimentalBorder": true`.
    if (property_exists($block_type, 'supports') && true === _wp_array_get($block_type->supports, array('__experimentalBorder'), $default)) {
        return true;
    }
    // Check if the specific feature has been opted into individually
    // via nested flag under `__experimentalBorder`.
    return block_has_support($block_type, array('__experimentalBorder', $feature), $default);
}