WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )
apply_filters( "hook_name", "what_to_filter" )
.Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
This hook occurs 2 times in this file.
Line | Code |
---|---|
758 | $wpdb->query("UPDATE $wpdb->posts SET guid = '" . get_permalink($post_ID) . "' WHERE ID = '$post_ID'"); |
759 |
|
760 | $post = get_post($post_ID); |
761 | if ( !empty($page_template) ) |
762 | $post->page_template = $page_template; |
763 |
|
764 | wp_transition_post_status($post_status, $previous_status, $post); |
765 |
|
766 | if ( $update) |
767 | do_action('edit_post', $post_ID, $post); |
768 |
|
769 | do_action('save_post', $post_ID, $post); |
770 | do_action('wp_insert_post', $post_ID, $post); |
771 |
|
772 | return $post_ID; |
773 | } |
774 |
|
775 | function wp_update_post($postarr = array()) { |
776 | global $wpdb; |
Line | Code |
823 | if ( 'publish' == $post->post_status ) |
824 | return; |
825 |
|
826 | $wpdb->query( "UPDATE $wpdb->posts SET post_status = 'publish' WHERE ID = '$post_id'" ); |
827 |
|
828 | $old_status = $post->post_status; |
829 | $post->post_status = 'publish'; |
830 | wp_transition_post_status('publish', $old_status, $post); |
831 |
|
832 | do_action('edit_post', $post_id, $post); |
833 | do_action('save_post', $post_id, $post); |
834 | do_action('wp_insert_post', $post_id, $post); |
835 | } |
836 |
|
837 | function wp_add_post_tags($post_id = 0, $tags = '') { |
838 | return wp_set_post_tags($post_id, $tags, true); |
839 | } |
840 |
|
841 | function wp_set_post_tags( $post_id = 0, $tags = '', $append = false ) { |