Make WordPress Core

Opened 3 years ago

Last modified 10 months ago

#16691 new feature request

Add do_action or menu description in nav-menus.php

Reported by: linguasite Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 3.1
Component: Menus Keywords: needs-patch
Focuses: Cc:


The nav menu feature uses the taxonomy structure but does not use i.e. the term description.
This field could be used by adding an action in wp-admin/nav-menus.php, for example in line 538 or 552.

<label class="menu-name-label howto open-label" for="menu-name">
	<span><?php _e('Menu Name'); ?></span>
	<input name="menu-name" id="menu-name" type="text" class="menu-name regular-text menu-item-textbox input-with-default-title" title="<?php esc_attr_e('Enter menu name here'); ?>" value="<?php echo esc_attr( $nav_menu_selected_title  ); ?>" />
<?php if ( !empty( $nav_menu_selected_id ) ) :
	if ( ! isset( $auto_add ) ) {
		$auto_add = get_option( 'nav_menu_options' );
		if ( ! isset( $auto_add['auto_add'] ) )
			$auto_add = false;
		elseif ( false !== array_search( $nav_menu_selected_id, $auto_add['auto_add'] ) )
			$auto_add = true;
			$auto_add = false;
<div class="auto-add-pages">
	<label class="howto"><input type="checkbox"<?php checked( $auto_add ); ?> name="auto-add-pages" value="1" /> <?php printf( __('Automatically add new top-level pages' ), esc_url( admin_url( 'edit.php?post_type=page' ) ) ); ?></label>
<?php endif; ?>

This would allow plugin developers to add additional fields or settings for nav menus and save them on updating or saving the menu.

Change History (2)

comment:1 ocean903 years ago

  • Component changed from Administration to Menus
  • Keywords needs-patch added
Note: See TracTickets for help on using tickets.