[wp-trac] [WordPress Trac] #64449: Block support: Add server-side processing for anchor
WordPress Trac
noreply at wordpress.org
Tue Dec 23 11:24:30 UTC 2025
#64449: Block support: Add server-side processing for anchor
-----------------------------+---------------------
Reporter: wildworks | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: 7.0
Component: Editor | Version:
Severity: normal | Resolution:
Keywords: gutenberg-merge | Focuses:
-----------------------------+---------------------
Changes (by wildworks):
* keywords: gutenberg-merge has-patch has-unit-tests => gutenberg-merge
Comment:
=== Testing instructions
WordPress core does not yet have any dynamic blocks that support anchors,
so run the following code to add `anchor` support to the Archive block:
{{{
#!php
add_filter( 'register_block_type_args', function( $args, $block_name ) {
if ( 'core/archives' === $block_name ) {
$args['supports']['anchor'] = true;
}
return $args;
}, 10, 2 );
}}}
- Open a post.
- Switch to Code Editor mode and enter the following HTML:
`<!-- wp:archives {"anchor":"my-anchor"} /-->`
- Save the post.
- On the frontend, the Archive block should have an ID attribute.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/64449#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list