' . __('Select menu items (pages, categories, links) from the boxes at left to begin building your custom menu.') . '
'; + $result .= '' . __( 'Add menu items from the column on the left.' ) . '
'; $result .= 'X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/699231ae09f7057a4d0000cdf32e50a3df6a04ca..61343b82c4f0da4c68e4c6373daafff4a81efdd1:/wp-admin/includes/nav-menu.php diff --git a/wp-admin/includes/nav-menu.php b/wp-admin/includes/nav-menu.php index e4675598..7e9fe6ad 100644 --- a/wp-admin/includes/nav-menu.php +++ b/wp-admin/includes/nav-menu.php @@ -7,25 +7,22 @@ * @since 3.0.0 * @uses Walker_Nav_Menu */ -class Walker_Nav_Menu_Edit extends Walker_Nav_Menu { +class Walker_Nav_Menu_Edit extends Walker_Nav_Menu { /** * @see Walker_Nav_Menu::start_lvl() * @since 3.0.0 * * @param string $output Passed by reference. - * @param int $depth Depth of page. */ - function start_lvl(&$output) {} + function start_lvl( &$output, $depth = 0, $args = array() ) {} /** * @see Walker_Nav_Menu::end_lvl() * @since 3.0.0 * * @param string $output Passed by reference. - * @param int $depth Depth of page. */ - function end_lvl(&$output) { - } + function end_lvl( &$output, $depth = 0, $args = array() ) {} /** * @see Walker::start_el() @@ -34,10 +31,9 @@ class Walker_Nav_Menu_Edit extends Walker_Nav_Menu { * @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 int $current_page Menu item ID. * @param object $args */ - function start_el(&$output, $item, $depth, $args) { + 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; @@ -57,6 +53,8 @@ class Walker_Nav_Menu_Edit extends Walker_Nav_Menu { $original_title = ''; if ( 'taxonomy' == $item->type ) { $original_title = get_term_field( 'name', $item->object_id, $item->object, 'raw' ); + if ( is_wp_error( $original_title ) ) + $original_title = false; } elseif ( 'post_type' == $item->type ) { $original_object = get_post( $item->object_id ); $original_title = $original_object->post_title; @@ -70,22 +68,30 @@ class Walker_Nav_Menu_Edit extends Walker_Nav_Menu { $title = $item->title; - if ( isset( $item->post_status ) && 'draft' == $item->post_status ) { + if ( ! empty( $item->_invalid ) ) { + $classes[] = 'menu-item-invalid'; + /* translators: %s: title of menu item which is invalid */ + $title = sprintf( __( '%s (Invalid)' ), $item->title ); + } elseif ( isset( $item->post_status ) && 'draft' == $item->post_status ) { $classes[] = 'pending'; /* translators: %s: title of menu item in draft status */ $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;"'; ?>
+
@@ -164,13 +167,24 @@ class Walker_Nav_Menu_Edit extends Walker_Nav_Menu {
+
+ +
+url ) . '">' . esc_html( $original_title ) . '' ); ?>
@@ -182,10 +196,10 @@ class Walker_Nav_Menu_Edit extends Walker_Nav_Menu { 'action' => 'delete-menu-item', 'menu-item' => $item_id, ), - remove_query_arg($removed_args, admin_url( 'nav-menus.php' ) ) + admin_url( 'nav-menus.php' ) ), 'delete-menu_item_' . $item_id - ); ?>"> | |' . sprintf( _n('Your theme supports %s menu. Select which menu you would like to use.', 'Your theme supports %s menus. Select which menu appears in each location.', $num_locations ), number_format_i18n($num_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 ) { ?> @@ -486,10 +516,7 @@ function wp_nav_menu_locations_meta_box() { + value="term_id; ?>">name, 40, '…' ); ?> @@ -498,12 +525,32 @@ function wp_nav_menu_locations_meta_box() { } ?>- - class="button-primary" name="nav-menu-locations" value="" /> + +
$_nav_menu_placeholder ? $_nav_menu_placeholder - 1 : -1; - $current_tab = 'create'; - if ( isset( $_REQUEST['customlink-tab'] ) && in_array( $_REQUEST['customlink-tab'], array('create', 'all') ) ) { - $current_tab = $_REQUEST['customlink-tab']; - } - - $removed_args = array( - 'action', - 'customlink-tab', - 'edit-menu-item', - 'menu-item', - 'page-tab', - '_wpnonce', - ); + $_nav_menu_placeholder = 0 > $_nav_menu_placeholder ? $_nav_menu_placeholder - 1 : -1; ?>+ +
- -- -
- -- -
++ +
- - class="button-secondary submit-add-to-menu" value="" name="add-custom-menu-item" id="submit-customlinkdiv" /> + class="button-secondary submit-add-to-menu right" value="" name="add-custom-menu-item" id="submit-customlinkdiv" /> +
@@ -619,7 +652,12 @@ function wp_nav_menu_item_post_type_meta_box( $object, $post_type ) { if ( !$posts ) $error = '- - - + + + 'submit-quick-search-posttype-' . $post_type_name ) ); ?>
-- - class="button-secondary submit-add-to-menu" value="" name="add-post-type-menu-item" id="submit-posttype-" /> + class="button-secondary submit-add-to-menu right" value="" name="add-post-type-menu-item" id="" /> +
@@ -793,7 +842,6 @@ function wp_nav_menu_item_taxonomy_meta_box( $object, $taxonomy ) { 'hide_empty' => false, 'hierarchical' => 1, 'include' => '', - 'include_last_update_time' => false, 'number' => $per_page, 'offset' => $offset, 'order' => 'ASC', @@ -826,7 +874,12 @@ function wp_nav_menu_item_taxonomy_meta_box( $object, $taxonomy ) { 'current' => $pagenum )); - $walker = new Walker_Nav_Menu_Checklist; + $db_fields = false; + if ( is_taxonomy_hierarchical( $taxonomy_name ) ) { + $db_fields = array( 'parent' => 'parent', 'id' => 'term_id' ); + } + + $walker = new Walker_Nav_Menu_Checklist( $db_fields ); $current_tab = 'most-used'; if ( isset( $_REQUEST[$taxonomy_name . '-tab'] ) && in_array( $_REQUEST[$taxonomy_name . '-tab'], array('all', 'most-used', 'search') ) ) { @@ -849,10 +902,22 @@ function wp_nav_menu_item_taxonomy_meta_box( $object, $taxonomy ) { ?>- - - + + + 'submit-quick-search-taxonomy-' . $taxonomy_name ) ); ?>
-' . __('Select menu items (pages, categories, links) from the boxes at left to begin building your custom menu.') . '
'; + $result .= '' . __( 'Add menu items from the column on the left.' ) . '
'; $result .= '' . __('Click Save Menu to make pending menu items public.') . '
' . __('There are some invalid menu items. Please check or delete them.') . '
' . $menu_item_db_id->get_error_message() . '
' . sprintf( __( '%1$s has been updated.' ), $nav_menu_selected_title ) . '