[wp-trac] Re: [WordPress Trac] #7029: get_post_ancestors() is broken

WordPress Trac wp-trac at lists.automattic.com
Fri May 30 17:51:00 GMT 2008


#7029: get_post_ancestors() is broken
-------------------------+--------------------------------------------------
 Reporter:  temoto       |        Owner:  anonymous
     Type:  defect       |       Status:  new      
 Priority:  normal       |    Milestone:  2.5.2    
Component:  General      |      Version:  2.5.1    
 Severity:  normal       |   Resolution:           
 Keywords:  needs-patch  |  
-------------------------+--------------------------------------------------
Changes (by Otto42):

  * keywords:  => needs-patch
  * summary:  Bad get_post_ancestors() => get_post_ancestors() is broken

Comment:

 I think this would fix it:
 {{{
 function get_post_ancestors($post) {
         if (is_integer($post)) $post = get_post($post);

         if ( !empty($post->ancestors) )
                 return $post->ancestors;

         return array();
 }
 }}}

-- 
Ticket URL: <http://trac.wordpress.org/ticket/7029#comment:1>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list