Make WordPress Core


Ignore:
Timestamp:
09/14/2008 12:58:00 PM (16 years ago)
Author:
azaozz
Message:

Publish postbox and post status select updates.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/post.php

    r8861 r8889  
    6363    if ( isset($post_data['advanced']) && '' != $post_data['advanced'] )
    6464        $post_data['post_status'] = 'draft';
     65    if ( isset($post_data['pending']) && '' != $post_data['pending'] )
     66        $post_data['post_status'] = 'pending';
    6567
    6668    $previous_status = get_post_field('post_status',  $post_data['ID']);
     
    6870    // Posts 'submitted for approval' present are submitted to $_POST the same as if they were being published.
    6971    // Change status from 'publish' to 'pending' if user lacks permissions to publish or to resave published posts.
    70     if ( 'page' == $post_data['post_type'] ) {
    71         if ( 'publish' == $post_data['post_status'] && !current_user_can( 'publish_pages' ) )
    72             if ( $previous_status != 'publish' OR !current_user_can( 'edit_published_pages') )
    73                 $post_data['post_status'] = 'pending';
    74     } else {
    75         if ( isset($post_data['post_status']) && ('publish' == $post_data['post_status'] && !current_user_can( 'publish_posts' )) ) :
    76             // Stop attempts to publish new posts, but allow already published posts to be saved if appropriate.
    77             if ( $previous_status != 'publish' OR !current_user_can( 'edit_published_posts') )
    78                 $post_data['post_status'] = 'pending';
    79         endif;
    80     }
    81 
     72    if ( isset($post_data['post_status']) && ('publish' == $post_data['post_status'] && !current_user_can( 'publish_posts' )) )
     73        if ( $previous_status != 'publish' OR !current_user_can( 'edit_published_pages') )
     74            $post_data['post_status'] = 'pending';
     75
     76    if ( ! isset($post_data['post_status']) )
     77        $post_data['post_status'] = $previous_status;
     78   
    8279    if (!isset( $post_data['comment_status'] ))
    8380        $post_data['comment_status'] = 'closed';
Note: See TracChangeset for help on using the changeset viewer.