AdvancedCustomFields / AdvancedCustomFields/acf

Gutenberg - Force refresh all blocks

Open
#225 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
945
Forks
197
PR merge metrics
No merged PRs in 30d

Description

Hello,
I have a rather peculiar issue - I am building a rather heavily customizable components library that uses a lot of themes. These themes can be applies either to individual blocks or to a whole page. This is done via radio button inside each individual block and another set of buttons on the sidebar of the whole page (to go with the Gutenberg look and functionality).

Now here is the kicker - It all works and I got it all tested, except for one tiny detail: When selecting the colors on individual blocks, the blocks instantly update, creating a wonderful preview of the color theme selected.
However, when changing the theme of the whole page, the individual blocks don't rerender.

Now, I realize there is probably some AJAX-based JSON magic behind the scenes to re-render the blocks every time anyway, so I am going to ask straight out: How do I tell ACF to request new AJAX request for all blocks?

I can handle hooking this up to the input change event on my own, I just need to know what to trigger, where and how.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the Gutenberg sidebar theme input change event and the ACF block-refresh AJAX entry point described in the report. Done means changing the page-wide theme causes all individual blocks to rerender, matching the behavior already seen when selecting colors on individual blocks.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, wordpress
Domain
frontend, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.