X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/a6f44f0edcda2471c5a33e4156c1c9488c7f3210..refs/tags/wordpress-3.7:/wp-admin/includes/nav-menu.php diff --git a/wp-admin/includes/nav-menu.php b/wp-admin/includes/nav-menu.php index 7e9fe6ad..d3aa7bd0 100644 --- a/wp-admin/includes/nav-menu.php +++ b/wp-admin/includes/nav-menu.php @@ -9,36 +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, $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, $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 = 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( @@ -57,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( @@ -214,7 +225,8 @@ class Walker_Nav_Menu_Edit extends Walker_Nav_Menu { \n"; } + /** + * 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. Used to append additional content. + * @param int $depth Depth of page. Used for padding. + * @param array $args Not used. + */ function end_lvl( &$output, $depth = 0, $args = array() ) { $indent = str_repeat( "\t", $depth ); $output .= "\n$indent"; } /** - * @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 = 0, $args = array(), $id = 0 ) { global $_nav_menu_placeholder; @@ -261,15 +299,23 @@ class Walker_Nav_Menu_Checklist extends Walker_Nav_Menu { $output .= $indent . '
  • '; $output .= ''; + $output .= ''; // Menu item hidden fields $output .= ''; @@ -283,7 +329,8 @@ class Walker_Nav_Menu_Checklist extends Walker_Nav_Menu { $output .= ''; $output .= ''; } -} + +} // Walker_Nav_Menu_Checklist /** * Prints the appropriate response to a menu quick search. @@ -486,51 +533,6 @@ function wp_nav_menu_taxonomy_meta_boxes() { } } -/** - * Displays a metabox for the nav menu theme locations. - * - * @since 3.0.0 - */ -function wp_nav_menu_locations_meta_box() { - global $nav_menu_selected_id; - - if ( ! current_theme_supports( 'menus' ) ) { - // We must only support widgets. Leave a message and bail. - echo '

    ' . __('The current theme does not natively support menus, but you can use the “Custom Menu” widget to add any menus you create here to the theme’s sidebar.') . '

    '; - return; - } - - $locations = get_registered_nav_menus(); - $menus = wp_get_nav_menus(); - $menu_locations = get_nav_menu_locations(); - $num_locations = count( array_keys($locations) ); - - echo '

    ' . _n( 'Select a menu to use within your theme.', 'Select the menus you will use in your theme.', $num_locations ) . '

    '; - - foreach ( $locations as $location => $description ) { - ?> -

    - -

    - -

    - - -

    -