AdvancedCustomFields / AdvancedCustomFields/acf
Gutenberg - Force refresh all blocks
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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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