Changes from branches/3.5/wp-includes/post.php at r23213 to trunk/wp-includes/post.php at r22989
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/post.php
r23213 r22989 683 683 function get_post_ancestors( $post ) { 684 684 if ( ! $post ) 685 return array();685 return false; 686 686 687 687 $post = get_post( $post ); … … 3011 3011 * 3012 3012 * @since 2.1.0 3013 * @uses $wpdb 3014 * @uses do_action() Calls 'edit_post', 'save_post', and 'wp_insert_post' on post_id and post data. 3013 * @uses wp_update_post() 3015 3014 * 3016 3015 * @param mixed $post Post ID or object. 3017 3016 */ 3018 3017 function wp_publish_post( $post ) { 3019 global $wpdb;3020 3021 3018 if ( ! $post = get_post( $post ) ) 3022 3019 return; 3023 3024 3020 if ( 'publish' == $post->post_status ) 3025 3021 return; 3026 3022 3027 $wpdb->update( $wpdb->posts, array( 'post_status' => 'publish' ), array( 'ID' => $post->ID ) );3028 3029 clean_post_cache( $post->ID );3030 3031 $old_status = $post->post_status;3032 3023 $post->post_status = 'publish'; 3033 wp_transition_post_status( 'publish', $old_status, $post ); 3034 3035 do_action( 'edit_post', $post->ID, $post ); 3036 do_action( 'save_post', $post->ID, $post ); 3037 do_action( 'wp_insert_post', $post->ID, $post ); 3024 wp_update_post( $post ); 3038 3025 } 3039 3026 … … 3595 3582 */ 3596 3583 function get_page_uri($page) { 3597 $page = get_post( $page );3598 3584 if ( ! is_object($page) ) 3585 $page = get_post( $page ); 3599 3586 $uri = $page->post_name; 3600 3587
Note: See TracChangeset
for help on using the changeset viewer.