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

do_action('wp_insert_post') is found 3 times:

  • /wp-includes/class-wp-customize-manager.php line 3121
    3117
    3118
    3119
    3120
    3121
    3122
    3123
    3124
    3125
    3126
    3127
    /** 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
    5067
    5068
    5069
    5070
    5071
    5072
    5073
    5074
    5075
    5076
    5077
    * @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
    5233
    5234
    5235
    5236
    5237
    5238
    5239
    5240
    5241
    5242
    5243
        /** 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: