Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: edit_post

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
1401                else
1402                     return 0;
1403           }
1404           update_post_meta($post_ID, '_wp_page_template',  $page_template);
1405      }
1406
1407      wp_transition_post_status($post_status, $previous_status, $post);
1408
1409      if ( $update)
1410           do_action('edit_post', $post_ID, $post);
1411
1412      do_action('save_post', $post_ID, $post);
1413      do_action('wp_insert_post', $post_ID, $post);
1414
1415      return $post_ID;
1416 }
1417
1418 /**
1419  * wp_update_post() - Update a post
 
Line Code
1496      $post->post_status = 'publish';
1497      wp_transition_post_status('publish', $old_status, $post);
1498
1499      // Update counts for the post's terms.
1500      foreach ( get_object_taxonomies('post') as $taxonomy ) {
1501           $terms = wp_get_object_terms($post_id, $taxonomy, 'fields=tt_ids');
1502           wp_update_term_count($terms, $taxonomy);
1503      }
1504
1505      do_action('edit_post', $post_id, $post);
1506      do_action('save_post', $post_id, $post);
1507      do_action('wp_insert_post', $post_id, $post);
1508 }
1509
1510 /**
1511  * check_and_publish_future_post() - check to make sure post has correct status before
1512  * passing it on to be published. Invoked by cron 'publish_future_post' event
1513  * This safeguard prevents cron from publishing drafts, etc.
1514  *