Make WordPress Core


Ignore:
Timestamp:
03/18/2009 09:43:51 PM (15 years ago)
Author:
westi
Message:

Allow a plugin to filter the classes applied in wp_list_pages. Fixes #9304 props willnorris.

File:
1 edited

Legend:

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

    r10810 r10814  
    11731173
    11741174        extract($args, EXTR_SKIP);
    1175         $css_class = 'page_item page-item-'.$page->ID;
     1175        $css_class = array('page_item', 'page-item-'.$page->ID);
    11761176        if ( !empty($current_page) ) {
    11771177            $_current_page = get_page( $current_page );
    11781178            if ( isset($_current_page->ancestors) && in_array($page->ID, (array) $_current_page->ancestors) )
    1179                 $css_class .= ' current_page_ancestor';
     1179                $css_class[] = 'current_page_ancestor';
    11801180            if ( $page->ID == $current_page )
    1181                 $css_class .= ' current_page_item';
     1181                $css_class[] = 'current_page_item';
    11821182            elseif ( $_current_page && $page->ID == $_current_page->post_parent )
    1183                 $css_class .= ' current_page_parent';
     1183                $css_class[] = 'current_page_parent';
    11841184        } elseif ( $page->ID == get_option('page_for_posts') ) {
    1185             $css_class .= ' current_page_parent';
    1186         }
     1185            $css_class[] = 'current_page_parent';
     1186        }
     1187       
     1188        $css_class = implode(' ', apply_filters('page_css_class', $css_class, $page));
    11871189
    11881190        $output .= $indent . '<li class="' . $css_class . '"><a href="' . get_page_link($page->ID) . '" title="' . attribute_escape(apply_filters('the_title', $page->post_title)) . '">' . $link_before . apply_filters('the_title', $page->post_title) . $link_after . '</a>';
Note: See TracChangeset for help on using the changeset viewer.