wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes
wp_has_border_feature_support is private and should not be used in themes or plugins directly.
wp_has_border_feature_support › WordPress Function
Depuis5.8.0
Dépréciéen/a
› wp_has_border_feature_support ( $block_type, $feature, $default_value = false )
| Accès: |
|
| Paramètres: (3) |
|
| Retourne: |
|
| Défini(e) dans: |
|
| Codex: |
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.Source
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 = $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 );
}