Make WordPress Core

Ticket #5723: wp-app.patch

File wp-app.patch, 1.2 KB (added by mrmist, 16 years ago)

refreshed against 10257

  • .php

    old new  
    439439
    440440                $publish = (isset($entry->draft) && trim($entry->draft) == 'yes') ? false : true;
    441441
    442                 $cap = ($publish) ? 'publish_posts' : 'edit_posts';
     442                if ($publish) { 
     443                        if (!current_user_can('publish_posts')) { 
     444                                $msg_cant_publish = __('Sorry, you do not have the right to publish new posts.'); 
     445                                if (!current_user_can('edit_posts')) { 
     446                                        $this->auth_required($msg_cant_publish); 
     447                                } else { 
     448                                        $this->auth_required($msg_cant_publish . ' ' . 
     449                                                __('Please submit your post as draft for review.')); 
     450                                } 
     451                        } 
     452                } else { 
     453                        if (!current_user_can('edit_posts'))   
     454                        $this->auth_required(__('Sorry, you do not have the right to submit new posts.')); 
     455                } 
     456               
    443457
    444                 if(!current_user_can($cap))
    445                         $this->auth_required(__('Sorry, you do not have the right to edit/publish new posts.'));
    446 
    447458                $blog_ID = (int ) $blog_id;
    448459                $post_status = ($publish) ? 'publish' : 'draft';
    449460                $post_author = (int) $user_ID;