Changeset 8032 for trunk/wp-admin/includes/post.php
- Timestamp:
- 06/02/2008 09:01:42 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/includes/post.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/post.php
r8011 r8032 58 58 $_POST['post_status'] = 'draft'; 59 59 60 $previous_status = get_post_field('post_status', $_POST['ID']); 61 62 // Posts 'submitted for approval' present are submitted to $_POST the same as if they were being published. 63 // Change status from 'publish' to 'pending' if user lacks permissions to publish or to resave published posts. 60 64 if ( 'page' == $_POST['post_type'] ) { 61 65 if ( 'publish' == $_POST['post_status'] && !current_user_can( 'publish_pages' ) ) 62 66 $_POST['post_status'] = 'pending'; 63 67 } else { 64 if ( 'publish' == $_POST['post_status'] && !current_user_can( 'publish_posts' ) ) 65 $_POST['post_status'] = 'pending'; 68 if ( 'publish' == $_POST['post_status'] && !current_user_can( 'publish_posts' ) ) : 69 // Stop attempts to publish new posts, but allow already published posts to be saved if appropriate. 70 if ( $previous_status != 'publish' OR !current_user_can( 'edit_published_posts') ) 71 $_POST['post_status'] = 'pending'; 72 endif; 66 73 } 67 74
Note: See TracChangeset
for help on using the changeset viewer.