I am really making a huge use of ACF’s options pages and repeater fields.
In order to reduce the amount of queries (from about 500 to 80) I’m caching some field outputs with the help of WordPress Transient API.
I know the hook for ACF options pages is:
add_action( 'acf/save_post', 'reference_function') );
But the problem for me is, that I have multiple options pages. And I don’t want all my functions to run when any options page is savedâ¦
These are my current options pages
add_filter('acf/options_page/settings', 'my_acf_options_page_settings');
if(function_exists("register_options_page")) {
acf_add_options_page();
register_options_page('Spielübersicht');
register_options_page('Mannschaft');
register_options_page('SCHWALBE arena TV');
register_options_page('Sponsoren');
register_options_page('Werbung');
register_options_page('Einstellung');
register_options_page('Fanclubs');
register_options_page('Sidebar');
}
Is there a way to filter the action so that my transients are only created when the related options page is saved?
Luckily I was able to solve my problem!
Have a look at my code in the pluginsâ support forum:
http://support.advancedcustomfields.com/forums/topic/acfsave_post-for-specific-options-page/