Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ACF Options Page Monitoring #206

Merged

Conversation

henrikwirth
Copy link
Contributor

@henrikwirth henrikwirth commented Nov 30, 2021

Possible related issues: #114, #174, #183, #181

This PR approaches the problem of ACF Option pages not triggering content updates in Gatsby if the options are "saved/updated".

As per suggestion of @TylerBarnes, trigger_non_node_root_field_update is used to update the option fields. By default this implementation would apply monitoring for all ACF registered option pages, but makes sure that it is only applied on those and not on normal post types to prevent triggering multiple content updates.

With the filter in place one can whitelist specific pages for monitoring or turn of monitoring by passing an empty array (or false).

add_filter('gatsby_action_monitor_tracked_acf_options_pages', function () {
    return ['my-custom-option-page'];
});
  • Adds ACF option page monitoring
  • Introduces Utils Class for helper functions
  • Introduces gatsby_action_monitor_tracked_acf_options_pages filter
  • Documentation

@TylerBarnes
Copy link
Collaborator

@henrikwirth thanks for this PR! I meant to get to this before the holidays but haven't had time quite yet. I'm going to wait til Jan 3rd to merge this and make a new release because I want to be around if anything goes wrong :) I set a reminder for myself 👍

@blakej115
Copy link

@TylerBarnes Can this get merged in? This is functionality that I must have, and would prefer to not have to pull from the forked repo if I don't have to. Thanks!

@TylerBarnes TylerBarnes merged commit 0bcf795 into gatsbyjs:master Feb 10, 2022
@TylerBarnes
Copy link
Collaborator

Published in v2.3.0

@TylerBarnes
Copy link
Collaborator

Thanks @henrikwirth !! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants