[wp-trac] Re: [WordPress Trac] #5608: Future Private Post is immediately visible

WordPress Trac wp-trac at lists.automattic.com
Fri Dec 19 09:46:47 GMT 2008

#5608: Future Private Post is immediately visible
 Reporter:  mattyrob                       |        Owner:  anonymous
     Type:  defect (bug)                   |       Status:  new      
 Priority:  normal                         |    Milestone:  2.8      
Component:  Administration                 |      Version:  2.3.2    
 Severity:  normal                         |   Resolution:           
 Keywords:  reporter-feedback needs-patch  |  
Comment (by x11tech):


 1.  Add new status:  future_private for private, scheduled posts/pages
 (original idea attrib to MattyRob)

 2.  Add language support to manage_posts form (/wp-admin/edit.php) and
 edit_post form (/wp-admin/post.php).  For example "Scheduled (Private)"

 3.  In function wp_insert_post check for private status, and if the date
 is in the future, then set $post_status = 'future_private'

 4.  In function check_and_publish_future_post, check if $post->post_status
 = 'future_private' as follows:

         if ( 'future' != $post->post_status )

         return wp_publish_post($post_id);

         if ( 'future' == $post->post_status || 'future_private' ==
 $post->post_status )
                 return wp_publish_post($post_id);



 This approach does the following:

 1.  Addresses need for scheduling private posts/pages

 2.  Provides a way to differentiate between future public and future

 3.  Remains backward compatible with existing future public method
 (publish_future_post hook)

 4.  Omits the need to add an additional field to be processed (no new
 variables to manage)

 5.  Simplifies conversion of private published content to private future
 content (If you publish private content, it's post_status private.  If you
 change the date to be in the future, then it auto converts private to
 future_private).  wp_insert_post is called regardless of whether we're
 creating a new post or updating an old post.

Ticket URL: <http://trac.wordpress.org/ticket/5608#comment:8>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software

More information about the wp-trac mailing list