Changeset 27964
- Timestamp:
- 04/05/2014 09:18:44 PM (11 years ago)
- Location:
- trunk/src/wp-admin/includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-posts-list-table.php
r27762 r27964 979 979 endif; // post_type_supports author 980 980 981 if ( !$bulk ) :981 if ( !$bulk && $can_publish ) : 982 982 ?> 983 983 -
trunk/src/wp-admin/includes/post.php
r27869 r27964 87 87 $post_data['post_status'] = 'draft'; 88 88 } 89 90 if ( ! get_post_status_object( $post_data['post_status'] ) ) { 91 unset( $post_data['post_status'] ); 92 } 89 93 } 90 94 … … 107 111 $previous_status = $post_id ? get_post_field( 'post_status', $post_id ) : false; 108 112 113 if ( isset( $post_data['post_status'] ) && 'private' == $post_data['post_status'] && ! current_user_can( $ptype->cap->publish_posts ) ) { 114 $post_data['post_status'] = $previous_status ? $previous_status : 'pending'; 115 } 116 109 117 $published_statuses = array( 'publish', 'future' ); 110 118 … … 117 125 if ( ! isset( $post_data['post_status'] ) ) { 118 126 $post_data['post_status'] = 'auto-draft' === $previous_status ? 'draft' : $previous_status; 127 } 128 129 if ( isset( $post_data['post_password'] ) && ! current_user_can( $ptype->cap->publish_posts ) ) { 130 unset( $post_data['post_password'] ); 119 131 } 120 132 … … 178 190 $post_data['post_mime_type'] = $post->post_mime_type; 179 191 192 if ( ! empty( $post_data['post_status'] ) ) { 193 $post_data['post_status'] = sanitize_key( $post_data['post_status'] ); 194 195 if ( 'inherit' == $post_data['post_status'] ) { 196 unset( $post_data['post_status'] ); 197 } 198 } 199 180 200 $ptype = get_post_type_object($post_data['post_type']); 181 201 if ( !current_user_can( 'edit_post', $post_ID ) ) { … … 194 214 _wp_upgrade_revisions_of_post( $post, wp_get_post_revisions( $post_ID ) ); 195 215 } 196 197 $post_data = _wp_translate_postdata( true, $post_data );198 if ( is_wp_error($post_data) )199 wp_die( $post_data->get_error_message() );200 216 201 217 if ( isset($post_data['visibility']) ) { … … 215 231 } 216 232 233 $post_data = _wp_translate_postdata( true, $post_data ); 234 if ( is_wp_error($post_data) ) 235 wp_die( $post_data->get_error_message() ); 236 217 237 // Post Formats 218 238 if ( isset( $post_data['post_format'] ) ) … … 351 371 } 352 372 unset($post_data['_status']); 373 374 if ( ! empty( $post_data['post_status'] ) ) { 375 $post_data['post_status'] = sanitize_key( $post_data['post_status'] ); 376 377 if ( 'inherit' == $post_data['post_status'] ) { 378 unset( $post_data['post_status'] ); 379 } 380 } 353 381 354 382 $post_IDs = array_map( 'intval', (array) $post_data['post'] ); … … 442 470 } 443 471 472 $post_data['post_type'] = $post->post_type; 444 473 $post_data['post_mime_type'] = $post->post_mime_type; 445 474 $post_data['guid'] = $post->guid; 446 475 476 foreach ( array( 'comment_status', 'ping_status', 'post_author' ) as $field ) { 477 if ( ! isset( $post_data[ $field ] ) ) { 478 $post_data[ $field ] = $post->$field; 479 } 480 } 481 447 482 $post_data['ID'] = $post_ID; 483 $post_data['post_ID'] = $post_ID; 484 485 $post_data = _wp_translate_postdata( true, $post_data ); 486 if ( is_wp_error( $post_data ) ) { 487 $skipped[] = $post_ID; 488 continue; 489 } 490 448 491 $updated[] = wp_update_post( $post_data ); 449 492
Note: See TracChangeset
for help on using the changeset viewer.