at path:
ROOT
/
wp-includes
/
block-supports
/
anchor.php
run:
R
W
Run
.htaccess
127 By
2026-05-27 01:21:48
R
W
Run
align.php
1.67 KB
2026-05-19 09:44:06
R
W
Run
Delete
Rename
anchor.php
1.54 KB
2026-05-21 05:46:38
R
W
Run
Delete
Rename
aria-label.php
1.65 KB
2026-05-21 05:46:38
R
W
Run
Delete
Rename
auto-register.php
2.18 KB
2026-05-21 05:46:38
R
W
Run
Delete
Rename
background.php
4.05 KB
2026-05-19 09:44:06
R
W
Run
Delete
Rename
block-style-variations.php
9.28 KB
2026-05-21 05:46:38
R
W
Run
Delete
Rename
block-visibility.php
5.23 KB
2026-05-21 05:46:38
R
W
Run
Delete
Rename
border.php
6.1 KB
2026-05-21 05:46:38
R
W
Run
Delete
Rename
colors.php
5.39 KB
2026-05-21 05:46:38
R
W
Run
Delete
Rename
custom-classname.php
1.64 KB
2026-05-19 09:44:06
R
W
Run
Delete
Rename
custom-css.php
9.37 KB
2026-05-21 05:46:38
R
W
Run
Delete
Rename
dimensions.php
5.21 KB
2026-05-21 05:46:38
R
W
Run
Delete
Rename
duotone.php
2.67 KB
2026-05-19 09:44:06
R
W
Run
Delete
Rename
elements.php
8.2 KB
2026-05-21 05:46:38
R
W
Run
Delete
Rename
generated-classname.php
1.7 KB
2026-05-19 09:44:06
R
W
Run
Delete
Rename
layout.php
42.31 KB
2026-05-21 05:46:38
R
W
Run
Delete
Rename
position.php
4.01 KB
2026-05-21 05:46:38
R
W
Run
Delete
Rename
settings.php
4.45 KB
2026-05-21 05:46:38
R
W
Run
Delete
Rename
shadow.php
2.04 KB
2026-05-19 09:44:06
R
W
Run
Delete
Rename
spacing.php
2.68 KB
2026-05-21 05:46:38
R
W
Run
Delete
Rename
typography.php
27.68 KB
2026-05-21 05:46:38
R
W
Run
Delete
Rename
utils.php
1011 By
2026-05-19 09:44:06
R
W
Run
Delete
Rename
error_log
up
📄
anchor.php
Save
<?php /** * Anchor block support flag. * * @package WordPress * @since 7.0.0 */ /** * Registers the anchor block attribute for block types that support it. * * @since 7.0.0 * @access private * * @param WP_Block_Type $block_type Block Type. */ function wp_register_anchor_support( WP_Block_Type $block_type ) { if ( ! block_has_support( $block_type, array( 'anchor' ) ) ) { return; } if ( ! isset( $block_type->attributes ) ) { $block_type->attributes = array(); } if ( ! array_key_exists( 'anchor', $block_type->attributes ) ) { $block_type->attributes['anchor'] = array( 'type' => 'string', ); } } /** * Add the anchor id to the output. * * @since 7.0.0 * @access private * * @param WP_Block_Type $block_type Block Type. * @param array<string, mixed> $block_attributes Block attributes. * @return array<string, string> Attributes with block anchor id. */ 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'] ); } // Register the block support. WP_Block_Supports::get_instance()->register( 'anchor', array( 'register_attribute' => 'wp_register_anchor_support', 'apply' => 'wp_apply_anchor_support', ) );