Skip to content

Function acf/save_post likewise wp save_post #82

@matata86

Description

@matata86

I have this function. I need delete cache if update option page.

function my_acf_save_post($post_id) {
  if ($post_id == 'options') {
    if(isset($GLOBALS['wp_fastest_cache']) && method_exists($GLOBALS['wp_fastest_cache'], 'deleteCache')){
      $GLOBALS['wp_fastest_cache']->deleteCache();
    }
  }
}
add_action('acf/save_post', 'my_acf_save_post', 20);

Function not run if options page has allow translate. If is page exclude from translate option page, works good.

Any issue?
Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions