Home Forums Gutenberg Anchor in WP-Blocks


Anchor in WP-Blocks

  • Hi there,

    I’m struggeling in getting the anchor field to a new ACF-Block, with acf_register_block_type.
    According to this page it should work:

    I tried: supports 'anchor' => true 'id' => true.
    But it always just show me the class-name, not any anchor or id field.

    Does anybody has an Idea what I’m making wrong?

  • Hello everyone,

    I am also confused with this option. Is it available somewhere? Where to set that 'anchor' for a block?

  • I’ve got this answer from the ACF-Support.

    Thank you for your email.

    I hate to be the bearer of bad news but the acf_register_block_type() function currently does not support the ‘anchor’ property. You can have a look at its documentation here

    I hope this helps and kindly let me know how this goes :).

  • My teammate calims that it works, just have to add 'supports' => array('anchor') while registering the block. Update the ACF, have a try and let me know

  • I just tried it with ACF 5.9.4.
    Unfortunately without success. Does it work for you?

  • Can you suggest something else because it is not working

  • @freddyfy @sabrinahill
    You need to set anchor to true, then click on the block in the panel admin and on the right side Block -> Advanced there is an anchor setting.

    'supports' => array( 'anchor' => true )
    ACF Block Anchor setting

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.