acf/save_post

The WordPress Core acf save post hook.

Description

add_action( 'acf/save_post', (callback) $array, (int) $int, (int) $int ); 

Parameters (3)

0. $array (callback) => array($this, 'set_terms')
The array.
1. $int (int) => 15
The int.
2. $int (int) => 1
The int.

Usage

To run the hook, copy the example below.
  1. // run the action 
  2. do_action( 'acf/save_post', $array, $int, $int ); 
The following example is for adding a hook callback.
  1. // define the acf/save_post callback 
  2. function action_acf_save_post( $array, $int, $int ) { 
  3. // make action magic happen here... 
  4. }; 
  5.  
  6. // add the action 
  7. add_action( 'acf/save_post', 'action_acf_save_post', 10, 3 ); 
To remove a hook callback, use the example below.
  1. // remove the action 
  2. remove_action( 'acf/save_post', 'action_acf_save_post', 10, 3 ); 

Defined (10)

The action is defined in the following location(s).

/core/fields/taxonomy.php  
  1. add_action('acf/save_post', array($this, 'set_terms'), 15, 1); 
/core/api.php  
  1. do_action('acf/save_post', $post_id); 
/core/controllers/post.php  
  1. do_action('acf/save_post', $post_id); 
/core/controllers/everything_fields.php  
  1. do_action('acf/save_post', $post_id); 
  1. do_action('acf/save_post', $post_id); 
  1. do_action('acf/save_post', $post_id); 
  1. do_action('acf/save_post', $post_id); 
/acf.php  
  1. add_action('acf/save_post', array($this, 'save_post_unlock'), 999); 
  1. add_action('acf/save_post', array($this, 'save_post'), 10); 
  1. add_action('acf/save_post', array($this, 'save_post_lock'), 0);