Home Forums Add-ons Options Page acf/save_post for specific options page Reply To: acf/save_post for specific options page

  • I found a solution after reading this post:

    While using WP get_current_screen()-function you can check if the ID in the output-array contains the slug of your specific option page.

    For example you have an options page called “adverts” and want run the function mentioned above when you save this specific option page:

    function clear_advert_main_transient() {
    	$screen = get_current_screen();
    	if (strpos($screen->id, "acf-options-adverts") == true) {
    add_action('acf/save_post', 'clear_advert_main_transient', 20);

    Now WP Transients make even more fun and will save you tons of queries if you have complex acf-fields and loops! 🙂