Changeset 24414 for trunk/wp-admin/includes/post.php
- Timestamp:
- 06/06/2013 02:39:08 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/post.php
r24408 r24414 1353 1353 1354 1354 if ( 'page' == $post->post_type ) { 1355 if ( ! current_user_can('edit_page', $post_ID) )1356 wp_die( __('You are not allowed to edit this page.'));1355 if ( ! current_user_can('edit_page', $post_ID) ) 1356 wp_die( __('You are not allowed to edit this page.') ); 1357 1357 } else { 1358 if ( ! current_user_can('edit_post', $post_ID) )1359 wp_die( __('You are not allowed to edit this post.'));1358 if ( ! current_user_can('edit_post', $post_ID) ) 1359 wp_die( __('You are not allowed to edit this post.') ); 1360 1360 } 1361 1361 1362 1362 $user_id = get_current_user_id(); 1363 if ( 'draft' == $post->post_status && $user_id == $post->post_author ) { 1363 $locked = wp_check_post_lock( $post->ID ); 1364 if ( ! $locked && 'draft' == $post->post_status && $user_id == $post->post_author ) { 1364 1365 $id = edit_post(); 1365 1366 } else { // Non drafts are not overwritten. The autosave is stored in a special post revision. … … 1372 1373 wp_die( $id->get_error_message() ); 1373 1374 1374 if ( $_POST['post_status'] == 'draft' && $user_id == $post->post_author ) {1375 if ( ! $locked && $_POST['post_status'] == 'draft' && $user_id == $post->post_author ) { 1375 1376 $url = add_query_arg( 'preview', 'true', get_permalink($id) ); 1376 1377 } else { 1377 1378 $nonce = wp_create_nonce('post_preview_' . $id); 1378 $url = add_query_arg( array( 'preview' => 'true', 'preview_id' => $id, 'preview_nonce' => $nonce ), get_permalink($id) ); 1379 $args = array( 1380 'preview' => 'true', 1381 'preview_id' => $id, 1382 'preview_nonce' => $nonce, 1383 ); 1384 1385 if ( isset( $_POST['post_format'] ) ) 1386 $args['post_format'] = empty( $_POST['post_format'] ) ? 'standard' : sanitize_key( $_POST['post_format'] ); 1387 1388 $url = add_query_arg( $args, get_permalink($id) ); 1379 1389 } 1380 1390
Note: See TracChangeset
for help on using the changeset viewer.