wpseek.com
Uma área de pesquisa sobre o WordPress para devs e autores do tema
block_has_support › WordPress Function
Desde5.8.0
Obsoleton/a
› block_has_support ( $block_type, $feature, $default_value = false )
Parâmetros: (3) |
|
Retorna: |
|
Definido em: |
|
Codex: | |
Log de mudanças: |
|
Checks whether the current block type supports the feature requested.
Funções relacionadas: wp_http_supports, remove_theme_support, get_theme_support, wp_cache_supports, wp_is_https_supported
Fonte
function block_has_support( $block_type, $feature, $default_value = false ) { $block_support = $default_value; if ( $block_type instanceof WP_Block_Type ) { if ( is_array( $feature ) && count( $feature ) === 1 ) { $feature = $feature[0]; } if ( is_array( $feature ) ) { $block_support = _wp_array_get( $block_type->supports, $feature, $default_value ); } elseif ( isset( $block_type->supports[ $feature ] ) ) { $block_support = $block_type->supports[ $feature ]; } } return true === $block_support || is_array( $block_support ); }