mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
Introduce get_post_ancestors(). Add current_page_ancestor class to ancestors of the current page. Props AaronCampbell. fixes #5662
git-svn-id: https://develop.svn.wordpress.org/trunk@7074 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -551,8 +551,10 @@ class Walker_Page extends Walker {
|
||||
extract($args, EXTR_SKIP);
|
||||
$css_class = 'page_item page-item-'.$page->ID;
|
||||
$_current_page = get_page( $current_page );
|
||||
if ( in_array($page->ID, $_current_page->ancestors) )
|
||||
$css_class .= ' current_page_ancestor';
|
||||
if ( $page->ID == $current_page )
|
||||
$css_class .= ' current_page_item ';
|
||||
$css_class .= ' current_page_item';
|
||||
elseif ( $_current_page && $page->ID == $_current_page->post_parent )
|
||||
$css_class .= ' current_page_parent';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user