wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes
wp_apply_anchor_support is private and should not be used in themes or plugins directly.
wp_apply_anchor_support › WordPress Function
Depuis7.0.0
Dépréciéen/a
› wp_apply_anchor_support ( $block_type, $block_attributes )
| Accès: |
|
| Paramètres: (2) |
|
| Retourne: |
|
| Défini(e) dans: |
|
| Codex: |
Add the anchor id to the output.
Fonctions en relation: wp_apply_colors_support, wp_apply_border_support, wp_apply_shadow_support, wp_apply_spacing_support, wp_apply_alignment_support
Source
function wp_apply_anchor_support( WP_Block_Type $block_type, array $block_attributes ): array {
if ( empty( $block_attributes ) ) {
return array();
}
if ( ! block_has_support( $block_type, array( 'anchor' ) ) ) {
return array();
}
if ( ! isset( $block_attributes['anchor'] ) || ! is_string( $block_attributes['anchor'] ) || '' === $block_attributes['anchor'] ) {
return array();
}
return array( 'id' => $block_attributes['anchor'] );
}