Opened 9 years ago
Last modified 5 years ago
#34657 new defect (bug)
WordPress doesn't set object terms for menu items so pending items not working
Reported by: | rss_samuel | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.3.1 |
Component: | Menus | Keywords: | dev-feedback has-patch reporter-feedback |
Focuses: | administration | Cc: |
Description (last modified by )
When I create menu items and refresh admin page without saving menu, wordpress can not show pending menu items.
At line 1127 of 'wp-admin/includes/ajax-functions.php' file there is wp_save_nav_menu_items function, the first argument for this function is always zero, so At line 441 of 'wp-includes/nav-menu.php' file wp_set_object_terms function doesn't work.
I add my menu id to
$item_ids = wp_save_nav_menu_items( 97, $menu_items_data );
function, and it working for me. :)
Attachments (1)
Change History (6)
#1
@
9 years ago
- Description modified (diff)
- Summary changed from Wordpress doesn't set object terms for menu items so pending items not working to WordPress doesn't set object terms for menu items so pending items not working
#5
@
8 years ago
- Keywords dev-feedback has-patch reporter-feedback added; needs-patch removed
Thanks for the patch!
Just one thing - I'm not sure we should be dying if $_POST['menu']
is not set. That block is meant to check whether the user has the capability to do this and it shouldn't ( in my opinion ) care if that item is set.
If we're just wanting to be sure that there is a value passed to the wp_save_nav_menu_items
it might be a good idea to use a ternary instead.
i.e $menu_id = ( isset( $_POST['menu'] ) ) ? absint( $_POST['menu'] ) : 0;
Hi!
Thanks for the ticket! It looks like you have an idea of how to address this - did you want to submit a patch?