Changeset 27976
- Timestamp:
- 04/06/2014 10:15:05 PM (11 years ago)
- Location:
- branches/3.8
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.8
- Property svn:mergeinfo changed
/trunk merged: 27964,27975
- Property svn:mergeinfo changed
-
branches/3.8/src/wp-admin/includes/class-wp-posts-list-table.php
r26245 r27976 840 840 endif; // post_type_supports author 841 841 842 if ( !$bulk ) :842 if ( !$bulk && $can_publish ) : 843 843 ?> 844 844 -
branches/3.8/src/wp-admin/includes/post.php
r26169 r27976 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.