Changeset 27977
- Timestamp:
- 04/06/2014 10:16:19 PM (11 years ago)
- Location:
- branches/3.7
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.7
- Property svn:mergeinfo changed
/branches/3.8 merged: 27976 /trunk merged: 27964,27975 reverse-merged: 18512
- Property svn:mergeinfo changed
-
branches/3.7/src/wp-admin/includes/class-wp-posts-list-table.php
r25868 r27977 833 833 endif; // post_type_supports author 834 834 835 if ( !$bulk ) :835 if ( !$bulk && $can_publish ) : 836 836 ?> 837 837 -
branches/3.7/src/wp-admin/includes/post.php
r25868 r27977 101 101 $previous_status = $post_id ? get_post_field( 'post_status', $post_id ) : false; 102 102 103 if ( isset( $post_data['post_status'] ) && 'private' == $post_data['post_status'] && ! current_user_can( $ptype->cap->publish_posts ) ) { 104 $post_data['post_status'] = $previous_status ? $previous_status : 'pending'; 105 } 106 103 107 $published_statuses = array( 'publish', 'future' ); 104 108 … … 111 115 if ( ! isset($post_data['post_status']) ) 112 116 $post_data['post_status'] = $previous_status; 117 118 if ( isset( $post_data['post_password'] ) && ! current_user_can( $ptype->cap->publish_posts ) ) { 119 unset( $post_data['post_password'] ); 120 } 113 121 114 122 if (!isset( $post_data['comment_status'] )) … … 171 179 $post_data['post_mime_type'] = $post->post_mime_type; 172 180 181 if ( ! empty( $post_data['post_status'] ) ) { 182 $post_data['post_status'] = sanitize_key( $post_data['post_status'] ); 183 184 if ( 'inherit' == $post_data['post_status'] ) { 185 unset( $post_data['post_status'] ); 186 } 187 } 188 173 189 $ptype = get_post_type_object($post_data['post_type']); 174 190 if ( !current_user_can( 'edit_post', $post_ID ) ) { … … 188 204 } 189 205 190 $post_data = _wp_translate_postdata( true, $post_data );191 if ( is_wp_error($post_data) )192 wp_die( $post_data->get_error_message() );193 206 if ( ( empty( $post_data['action'] ) || 'autosave' != $post_data['action'] ) && 'auto-draft' == $post_data['post_status'] ) { 194 207 $post_data['post_status'] = 'draft'; … … 211 224 } 212 225 226 $post_data = _wp_translate_postdata( true, $post_data ); 227 if ( is_wp_error($post_data) ) 228 wp_die( $post_data->get_error_message() ); 229 213 230 // Post Formats 214 231 if ( isset( $post_data['post_format'] ) ) … … 332 349 } 333 350 unset($post_data['_status']); 351 352 if ( ! empty( $post_data['post_status'] ) ) { 353 $post_data['post_status'] = sanitize_key( $post_data['post_status'] ); 354 355 if ( 'inherit' == $post_data['post_status'] ) { 356 unset( $post_data['post_status'] ); 357 } 358 } 334 359 335 360 $post_IDs = array_map( 'intval', (array) $post_data['post'] ); … … 423 448 } 424 449 450 $post_data['post_type'] = $post->post_type; 425 451 $post_data['post_mime_type'] = $post->post_mime_type; 426 452 $post_data['guid'] = $post->guid; 427 453 454 foreach ( array( 'comment_status', 'ping_status', 'post_author' ) as $field ) { 455 if ( ! isset( $post_data[ $field ] ) ) { 456 $post_data[ $field ] = $post->$field; 457 } 458 } 459 428 460 $post_data['ID'] = $post_ID; 461 $post_data['post_ID'] = $post_ID; 462 463 $post_data = _wp_translate_postdata( true, $post_data ); 464 if ( is_wp_error( $post_data ) ) { 465 $skipped[] = $post_ID; 466 continue; 467 } 468 429 469 $updated[] = wp_update_post( $post_data ); 430 470 … … 570 610 return edit_post(); 571 611 572 $translated = _wp_translate_postdata( false );573 if ( is_wp_error($translated) )574 return $translated;575 576 612 if ( isset($_POST['visibility']) ) { 577 613 switch ( $_POST['visibility'] ) { … … 589 625 } 590 626 } 627 628 $translated = _wp_translate_postdata( false ); 629 if ( is_wp_error($translated) ) 630 return $translated; 591 631 592 632 // Create the post.
Note: See TracChangeset
for help on using the changeset viewer.