[wp-trac] [WordPress Trac] #12443: General get_ancestors() function

WordPress Trac wp-trac at lists.automattic.com
Mon Mar 1 15:42:08 UTC 2010


#12443: General get_ancestors() function
-------------------------+--------------------------------------------------
 Reporter:  filosofo     |       Owner:  filosofo               
     Type:  enhancement  |      Status:  new                    
 Priority:  normal       |   Milestone:  3.0                    
Component:  Taxonomy     |     Version:  3.0                    
 Severity:  normal       |    Keywords:  get_ancestors has-patch
-------------------------+--------------------------------------------------
 `get_ancestors([object_id], [object_type])` returns an array of the
 ancestor objects, starting from closest in hierarchy to highest.

 This would be helpful for determining general inheritance in themes and
 plugins.

 For example:

 {{{
 if ( in_array(123, get_ancestors(456, 'page') ) ) {
    // highlight a menu item, or query a particular set of objects
 }
 }}}

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


More information about the wp-trac mailing list