publish_post

The WordPress Core publish post hook.

Description

remove_action( 'publish_post', (string) $queue_publish_post ); 

Parameters (1)

0. $queue_publish_post (string) => 'queue_publish_post'
The queue publish post.

Usage

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

Defined (3)

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

/modules/custom-css/custom-css.php  
  1. remove_action( 'publish_post', 'queue_publish_post' ); 
/modules/sitemaps/sitemaps.php  
  1. add_action( 
/modules/widgets/authors.php  
  1. add_action( 'publish_post', array( __CLASS__, 'flush_cache' ) );