Support

Account

Home Forums Gutenberg Update ACF block data when not selected

Unread

Update ACF block data when not selected

    • mrsd

    • March 26, 2021 at 9:39 pm

    Hi all,

    Basically, I want to be able to update an ACF block’s attribute (and potentially re-render it) whilst it is not selected, and so the ACF input for that attribute does not currently exist on the page.

    When a block is selected, in the sidebar there would be the input to change the value of the attribute, which would then re-render the block. I want to simulate that change event, so that my block receives the new value, without requiring user input.

    I have looked at the docs but not found anything too useful, the closest was acf.getField(‘field_6058fe03eedf2’).val( ‘myValue’ ) which would change the selected blocks attribute, but I’d need to do this for multiple unselected blocks.

    Is this possible?

    Thanks for any help you can provide.

Viewing 1 post (of 1 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.