[wp-trac] [WordPress Trac] #2763: get_post_status should use post_status = inherit instead of post_type = attachment

WordPress Trac wp-trac at lists.automattic.com
Thu Jun 1 17:06:28 GMT 2006


#2763: get_post_status should use post_status = inherit instead of post_type =
attachment
----------------------------+-----------------------------------------------
       Id:  2763            |      Status:  new                     
Component:  Administration  |    Modified:  Thu Jun  1 17:06:28 2006
 Severity:  normal          |   Milestone:  2.1                     
 Priority:  normal          |     Version:  2.1                     
    Owner:  anonymous       |    Reporter:  ryanscheuermann         
----------------------------+-----------------------------------------------
 The function get_post_status gets the inherited post_status if the
 post_type = 'attachment', but shouldn't it test if post_status = 'inherit'
 instead?  I'm attempting to allow attachments to be marked "private"
 regardless of their parent post/page's status.  It's my assumption that by
 default, attachments have post_status = 'inherit', so changing this line
 shouldn't break anything.

 get_post_status should be:

 {{{
 function get_post_status($ID = '') {
         $post = get_post($ID);

         if ( is_object($post) ) {
                 if ( ('inherit' == $post->post_status) &&
 $post->post_parent && ($post->ID != $post->post_parent) )
                         return get_post_status($post->post_parent);
                 else
                         return $post->post_status;
         }

         return false;
 }
 }}}

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


More information about the wp-trac mailing list