pll_save_post

Fires after the post language and translations are saved.

Description

do_action( 'pll_save_post', (int) $post_id, (object) $post, (array) $this_model_post_get_translations_post_id ); 

Parameters (3)

0. $post_id (int)
The post id.
1. $post (object)
Post object
2. $this_model_post_get_translations_post_id (array) => empty( $translations ) ? $this->model->post->get_translations( $post_id ) : $translations
The list of translations post ids

Usage

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

Defined (1)

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

/admin/admin-filters-post.php  
  1. do_action( 'pll_save_post', $post_id, $post, empty( $translations ) ? $this->model->post->get_translations( $post_id ) : $translations );