Adding class “current_page_item” for custom post type menu

Check this ticket: http://core.trac.wordpress.org/ticket/17590

Quickfix by husobj:

function my_page_css_class( $css_class, $page ) {
    global $post;
    if ( $post->ID == $page->ID ) {
        $css_class[] = 'current_page_item';
    }
    return $css_class;
}
add_filter( 'page_css_class', 'my_page_css_class', 10, 2 );

The quickfix might be an easier alternative?
Cheers

Leave a Comment