WordPress.org

Make WordPress Core

Opened 2 years ago

Last modified 8 weeks ago

#20257 new enhancement

Url of navigation menu item of alternative type removed

Reported by: stephenh1988 Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 3.3.1
Component: Menus Keywords: close reporter-feedback
Focuses: Cc:

Description

When creating a new navigation menu item with wp_update_nav_menu_item the url is removed if the type of the item is not 'custom'. If the type of the item is 'taxonomy' or 'post_type', the url is then set appropriately. However, if the item has a type other than 'custom','taxonomy', or 'post_type' the menu item is saved without an url.

wp-includes/nav-menu.php L314

if ( 'custom' != $args['menu-item-type'] ) {
     /* if non-custom menu item, then:
     * use original object's URL
     * blank default title to sync with original object's
     */

     $args['menu-item-url'] = '';

Attachments (1)

20257.patch (788 bytes) - added by ocean90 8 weeks ago.

Download all attachments as: .zip

Change History (3)

comment:1 stephenh19882 years ago

  • Cc stephen@… added

ocean908 weeks ago

comment:2 ocean908 weeks ago

  • Keywords close reporter-feedback added
  • Type changed from defect (bug) to enhancement

Hello stephenh1988, sorry you never got a response.

Why do you need an alternative type? Is this the only issue when using a new object type? If yes, something like 20257.patch could work. But for the UI Walker_Nav_Menu_Edit needs probably some changes too.

But I'm more in favor of wontfix since the ticket has had no traction in two years.

Note: See TracTickets for help on using tickets.