[wp-trac] [WordPress Trac] #4206: Publish button overrides Private post status

WordPress Trac wp-trac at lists.automattic.com
Sat Apr 28 19:04:57 GMT 2007


#4206: Publish button overrides Private post status
----------------------------+-----------------------------------------------
 Reporter:  mattyrob        |       Owner:  anonymous
     Type:  defect          |      Status:  new      
 Priority:  normal          |   Milestone:  2.1.4    
Component:  Administration  |     Version:  2.1.3    
 Severity:  normal          |    Keywords:           
----------------------------+-----------------------------------------------
 When writing a new post, if a user sets the post status to "Private" and
 then clicks publish the post actually goes into the blog as a "Published"
 post, not a private one.

 The code causing this (I think) is the wp_publish_post function in wp-
 includes/posts.php, it containes the following line:


 {{{
 return wp_update_post(array('post_status' => 'publish', 'ID' => $post_id,
 'no_filter' => true));
 }}}

 There are some if statements prior to this that check if the post is
 already published, perhaps a check could be put here to see if the post is
 private and a new line added as follows if this evaluates as true.

 {{{
 return wp_update_post(array('post_status' => 'private', 'ID' => $post_id,
 'no_filter' => true));
 }}}

 '''This patch is untried!!'''

-- 
Ticket URL: <http://trac.wordpress.org/ticket/4206>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list