Changeset 9055
- Timestamp:
- 10/02/2008 04:10:54 AM (16 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/edit-form-advanced.php
r9054 r9055 375 375 <?php 376 376 } 377 add_meta_box('slugdiv', __('Post Slug'), 'post_slug_meta_box', 'post', 'normal', 'core'); 377 if ( !( 'pending' == $post->post_status && !current_user_can( 'publish_posts' ) ) ) 378 add_meta_box('slugdiv', __('Post Slug'), 'post_slug_meta_box', 'post', 'normal', 'core'); 378 379 379 380 $authors = get_editable_user_ids( $current_user->id ); // TODO: ROLE SYSTEM … … 482 483 <div class="inside"> 483 484 <?php $sample_permalink_html = get_sample_permalink_html($post->ID); ?> 485 <?php if ( !( 'pending' == $post->post_status && !current_user_can( 'publish_posts' ) ) ) { ?> 484 486 <div id="edit-slug-box"> 485 487 <?php if ( ! empty($post->ID) && ! empty($sample_permalink_html) ) : … … 487 489 endif; ?> 488 490 </div> 491 <?php } ?> 489 492 </div> 490 493 </div> -
trunk/wp-includes/post.php
r8966 r9055 1351 1351 } 1352 1352 1353 // Create a valid post name. Drafts are allowed to have an empty 1353 // Don't allow contributors to set to set the post slug for pending review posts 1354 if ( 'pending' == $post_status && !current_user_can( 'publish_posts' ) ) 1355 $post_name = ''; 1356 1357 // Create a valid post name. Drafts and pending posts are allowed to have an empty 1354 1358 // post name. 1355 1359 if ( empty($post_name) ) { 1356 if ( 'draft' != $post_status)1360 if ( !in_array( $post_status, array( 'draft', 'pending' ) ) ) 1357 1361 $post_name = sanitize_title($post_title); 1358 1362 } else { … … 1360 1364 } 1361 1365 1362 // If the post date is empty (due to having been new or a draft) and status is not 'draft' , set date to now1366 // If the post date is empty (due to having been new or a draft) and status is not 'draft' or 'pending', set date to now 1363 1367 if ( empty($post_date) || '0000-00-00 00:00:00' == $post_date ) 1364 1368 $post_date = current_time('mysql'); 1365 1369 1366 1370 if ( empty($post_date_gmt) || '0000-00-00 00:00:00' == $post_date_gmt ) { 1367 if ( !in_array( $post_status, array('draft', 'pending')) )1371 if ( !in_array( $post_status, array( 'draft', 'pending' ) ) ) 1368 1372 $post_date_gmt = get_gmt_from_date($post_date); 1369 1373 else … … 1415 1419 $post_password = ''; 1416 1420 1417 if ( 'draft' != $post_status) {1421 if ( !in_array( $post_status, array( 'draft', 'pending' ) ) ) { 1418 1422 $post_name_check = $wpdb->get_var($wpdb->prepare("SELECT post_name FROM $wpdb->posts WHERE post_name = %s AND post_type = %s AND ID != %d AND post_parent = %d LIMIT 1", $post_name, $post_type, $post_ID, $post_parent)); 1419 1423 … … 1458 1462 } 1459 1463 1460 if ( empty($post_name) && 'draft' != $post_status) {1464 if ( empty($post_name) && !in_array( $post_status, array( 'draft', 'pending' ) ) ) { 1461 1465 $post_name = sanitize_title($post_title, $post_ID); 1462 1466 $wpdb->update( $wpdb->posts, compact( 'post_name' ), $where );
Note: See TracChangeset
for help on using the changeset viewer.