Ticket #26809: 26809.patch
File 26809.patch, 1.8 KB (added by , 11 years ago) |
---|
-
wp-includes/post.php
2879 2879 $data = wp_unslash( $data ); 2880 2880 $where = array( 'ID' => $post_ID ); 2881 2881 2882 if ( !empty($page_template) && 'page' == $data['post_type'] ) { 2883 $post->page_template = $page_template; 2884 $page_templates = wp_get_theme()->get_page_templates(); 2885 if ( 'default' != $page_template && ! isset( $page_templates[ $page_template ] ) ) { 2886 if ( $wp_error ) 2887 return new WP_Error('invalid_page_template', __('The page template is invalid.')); 2888 else { 2889 return 0; 2890 } 2891 } 2892 2882 2893 if ( $update ) { 2883 2894 do_action( 'pre_post_update', $post_ID, $data ); 2884 2895 if ( false === $wpdb->update( $wpdb->posts, $data, $where ) ) { … … 2942 2953 $post = get_post($post_ID); 2943 2954 2944 2955 if ( !empty($page_template) && 'page' == $data['post_type'] ) { 2945 $post->page_template = $page_template;2946 $page_templates = wp_get_theme()->get_page_templates();2947 if ( 'default' != $page_template && ! isset( $page_templates[ $page_template ] ) ) {2948 if ( $wp_error )2949 return new WP_Error('invalid_page_template', __('The page template is invalid.'));2950 else2951 return 0;2952 }2953 2956 update_post_meta($post_ID, '_wp_page_template', $page_template); 2954 2957 } 2955 2958 -
wp-admin/includes/post.php
278 278 279 279 update_post_meta( $post_ID, '_edit_last', get_current_user_id() ); 280 280 281 wp_update_post( $post_data ); 281 $status = wp_update_post( $post_data, true ); 282 if ( is_wp_error( $status ) ) { 283 wp_die( $status->get_error_message() ); 284 } 282 285 283 286 // Now that we have an ID we can fix any attachment anchor hrefs 284 287 _fix_attachment_links( $post_ID );