WordPress.org

Make WordPress Core

Ticket #5723: wp-app.diff

File wp-app.diff, 1.2 KB (added by toydi, 10 years ago)

patch with the proposed response message

  • wp-app.php

     
    248248                }
    249249
    250250                $publish = (isset($entry->draft) && trim($entry->draft) == 'yes') ? false : true;
     251       
     252        if ($publish) {
     253            if (!current_user_can('publish_posts')) {
     254                $msg_cant_publish = __('Sorry, you do not have the right to publish new posts.');
    251255
    252                 $cap = ($publish) ? 'publish_posts' : 'edit_posts';
     256                if (!current_user_can('edit_posts')) {
     257                    $this->auth_required($msg_cant_publish);
     258                } else {
     259                    $this->auth_required($msg_cant_publish . ' ' .
     260                             __('Please submit your post as draft for review.'));
     261                }
     262            }
     263        } else {
     264            if (!current_user_can('edit_posts'))
     265                $this->auth_required(__('Sorry, you do not have the right to submit new posts.'));
     266        }
    253267
    254                 if(!current_user_can($cap))
    255                         $this->auth_required(__('Sorry, you do not have the right to edit/publish new posts.'));
    256 
    257268                $blog_ID = (int ) $blog_id;
    258269                $post_status = ($publish) ? 'publish' : 'draft';
    259270                $post_author = (int) $user_ID;