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.5.2

do_action('wp_insert_post') is found 3 times:

  • /wp-includes/class-wp-customize-manager.php line 3116
    		/** 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 4839
    	 * @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 5005
    	/** 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: