wp_insert_post

wp_insert_post

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: action
See hook in action

See hook in core

Displaying hooks found in version: wordpress-6.7.1

do_action('wp_insert_post') is found 3 times:

  • /wp-includes/class-wp-customize-manager.php line 3121
    		/** This action is documented in wp-includes/post.php */
    		do_action( 'save_post', $post->ID, $post, true );
    
    		/** This action is documented in wp-includes/post.php */
    		do_action( 'wp_insert_post', $post->ID, $post, true );
    
    		wp_after_insert_post( get_post( $post_id ), true, $post );
    
    		wp_trash_post_comments( $post_id );
    
    		/** This action is documented in wp-includes/post.php */
    
  • /wp-includes/post.php line 5071
    	 * @param int     $post_id Post ID.
    	 * @param WP_Post $post    Post object.
    	 * @param bool    $update  Whether this is an existing post being updated.
    	 */
    	do_action( 'wp_insert_post', $post_id, $post, $update );
    
    	if ( $fire_after_hooks ) {
    		wp_after_insert_post( $post, $update, $post_before );
    	}
    
    	return $post_id;
    
  • /wp-includes/post.php line 5237
    	/** This action is documented in wp-includes/post.php */
    	do_action( 'save_post', $post->ID, $post, true );
    
    	/** This action is documented in wp-includes/post.php */
    	do_action( 'wp_insert_post', $post->ID, $post, true );
    
    	wp_after_insert_post( $post, true, $post_before );
    }
    
    /**
     * Publishes future post and make sure post ID has future post status.
    

See this hook used in plugins: