Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: edit_post_{$post->post_type}

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

This hook occurs 2 times in this file.

Line Code
4251            *
4252            * The dynamic portion of the hook name, `$post->post_type`, refers to
4253            * the post type slug.
4254            *
4255            * @since 5.1.0
4256            *
4257            * @param int     $post_ID Post ID.
4258            * @param WP_Post $post    Post object.
4259            */
4260           do_action( "edit_post_{$post->post_type}", $post_ID, $post );
4261
4262           /**
4263            * Fires once an existing post has been updated.
4264            *
4265            * @since 1.2.0
4266            *
4267            * @param int     $post_ID Post ID.
4268            * @param WP_Post $post    Post object.
4269            */
 
Line Code
4465      $wpdb->update( $wpdb->posts, array( 'post_status' => 'publish' ), array( 'ID' => $post->ID ) );
4466
4467      clean_post_cache( $post->ID );
4468
4469      $old_status        = $post->post_status;
4470      $post->post_status = 'publish';
4471      wp_transition_post_status( 'publish', $old_status, $post );
4472
4473      /** This action is documented in wp-includes/post.php */
4474      do_action( "edit_post_{$post->post_type}", $post->ID, $post );
4475
4476      /** This action is documented in wp-includes/post.php */
4477      do_action( 'edit_post', $post->ID, $post );
4478
4479      /** This action is documented in wp-includes/post.php */
4480      do_action( "save_post_{$post->post_type}", $post->ID, $post, true );
4481
4482      /** This action is documented in wp-includes/post.php */
4483      do_action( 'save_post', $post->ID, $post, true );