Changeset 23740
- Timestamp:
- 03/18/2013 02:33:09 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/post.php
r23722 r23740 2636 2636 2637 2637 // Are we updating or creating? 2638 $post_ID = 0; 2638 2639 $update = false; 2639 if ( ! empty($ID) ) {2640 if ( ! empty( $ID ) ) { 2640 2641 $update = true; 2642 2643 // Get the post ID and GUID 2644 $post_ID = $ID; 2645 $post_before = get_post( $post_ID ); 2646 if ( is_null( $post_before ) ) { 2647 if ( $wp_error ) 2648 return new WP_Error( 'invalid_post', __( 'Invalid post ID.' ) ); 2649 return 0; 2650 } 2651 2652 $guid = get_post_field( 'guid', $post_ID ); 2641 2653 $previous_status = get_post_field('post_status', $ID); 2642 2654 } else { … … 2673 2685 if ( empty($post_author) ) 2674 2686 $post_author = $user_ID; 2675 2676 $post_ID = 0;2677 2678 // Get the post ID and GUID2679 if ( $update ) {2680 $post_ID = (int) $ID;2681 $guid = get_post_field( 'guid', $post_ID );2682 $post_before = get_post($post_ID);2683 }2684 2687 2685 2688 // Don't allow contributors to set the post slug for pending review posts … … 2894 2897 // First, get all of the original fields 2895 2898 $post = get_post($postarr['ID'], ARRAY_A); 2899 2900 if ( is_null( $post ) ) { 2901 if ( $wp_error ) 2902 return new WP_Error( 'invalid_post', __( 'Invalid post ID.' ) ); 2903 return 0; 2904 } 2896 2905 2897 2906 // Escape data pulled from DB.
Note: See TracChangeset
for help on using the changeset viewer.