Allow wp_nav_menu_items filters to run on the backend as well. props NathanRice, fixes #13371.

git-svn-id: http://svn.automattic.com/wordpress/trunk@14592 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2010-05-13 03:50:26 +00:00
parent 6a3d1484bf
commit c6572a1d16
1 changed files with 3 additions and 7 deletions

View File

@ -251,13 +251,9 @@ function wp_nav_menu( $args = array() ) {
$nav_menu .= '<ul'. $attributes .'>';
// Allow plugins to hook into the menu to add their own <li>'s
if ( 'frontend' == $args->context ) {
$items = apply_filters( 'wp_nav_menu_items', $items, $args );
$items = apply_filters( "wp_nav_menu_{$menu->slug}_items", $items, $args );
$nav_menu .= $items;
} else {
$nav_menu .= $items;
}
$items = apply_filters( 'wp_nav_menu_items', $items, $args );
$items = apply_filters( "wp_nav_menu_{$menu->slug}_items", $items, $args );
$nav_menu .= $items;
unset($items);
$nav_menu .= '</ul>';