X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/6c8f14c09105d0afa4c1574215c59b5021040e76..refs/tags/wordpress-4.0:/wp-admin/includes/nav-menu.php diff --git a/wp-admin/includes/nav-menu.php b/wp-admin/includes/nav-menu.php index 60644628..44f3ee08 100644 --- a/wp-admin/includes/nav-menu.php +++ b/wp-admin/includes/nav-menu.php @@ -9,37 +9,47 @@ */ class Walker_Nav_Menu_Edit extends Walker_Nav_Menu { /** + * Starts the list before the elements are added. + * * @see Walker_Nav_Menu::start_lvl() + * * @since 3.0.0 * * @param string $output Passed by reference. + * @param int $depth Depth of menu item. Used for padding. + * @param array $args Not used. */ - function start_lvl(&$output) {} + public function start_lvl( &$output, $depth = 0, $args = array() ) {} /** + * Ends the list of after the elements are added. + * * @see Walker_Nav_Menu::end_lvl() + * * @since 3.0.0 * * @param string $output Passed by reference. + * @param int $depth Depth of menu item. Used for padding. + * @param array $args Not used. */ - function end_lvl(&$output) { - } + public function end_lvl( &$output, $depth = 0, $args = array() ) {} /** - * @see Walker::start_el() + * Start the element output. + * + * @see Walker_Nav_Menu::start_el() * @since 3.0.0 * * @param string $output Passed by reference. Used to append additional content. - * @param object $item Menu item data object. - * @param int $depth Depth of menu item. Used for padding. - * @param object $args + * @param object $item Menu item data object. + * @param int $depth Depth of menu item. Used for padding. + * @param array $args Not used. + * @param int $id Not used. */ - function start_el(&$output, $item, $depth, $args) { + public function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) { global $_wp_nav_menu_max_depth; $_wp_nav_menu_max_depth = $depth > $_wp_nav_menu_max_depth ? $depth : $_wp_nav_menu_max_depth; - $indent = ( $depth ) ? str_repeat( "\t", $depth ) : ''; - ob_start(); $item_id = esc_attr( $item->ID ); $removed_args = array( @@ -58,7 +68,7 @@ class Walker_Nav_Menu_Edit extends Walker_Nav_Menu { $original_title = false; } elseif ( 'post_type' == $item->type ) { $original_object = get_post( $item->object_id ); - $original_title = $original_object->post_title; + $original_title = get_the_title( $original_object->ID ); } $classes = array( @@ -79,13 +89,17 @@ class Walker_Nav_Menu_Edit extends Walker_Nav_Menu { $title = sprintf( __('%s (Pending)'), $item->title ); } - $title = empty( $item->label ) ? $title : $item->label; + $title = ( ! isset( $item->label ) || '' == $item->label ) ? $title : $item->label; + + $submenu_text = ''; + if ( 0 == $depth ) + $submenu_text = 'style="display: none;"'; ?>