Make WordPress Core


Ignore:
Timestamp:
02/27/2008 11:28:18 PM (17 years ago)
Author:
ryan
Message:

Introduce get_post_ancestors(). Add current_page_ancestor class to ancestors of the current page. Props AaronCampbell. fixes #5662

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/classes.php

    r6956 r7074  
    552552        $css_class = 'page_item page-item-'.$page->ID;
    553553        $_current_page = get_page( $current_page );
     554        if ( in_array($page->ID, $_current_page->ancestors) )
     555            $css_class .= ' current_page_ancestor';
    554556        if ( $page->ID == $current_page )
    555             $css_class .= ' current_page_item ';
     557            $css_class .= ' current_page_item';
    556558        elseif ( $_current_page && $page->ID == $_current_page->post_parent )
    557559            $css_class .= ' current_page_parent';
Note: See TracChangeset for help on using the changeset viewer.