[wp-trac] [WordPress Trac] #55893: Not able to save navigation menus and not able to retrieve menus using wp_get_nav_menu_items

WordPress Trac noreply at wordpress.org
Wed Jun 1 21:10:27 UTC 2022


#55893: Not able to save navigation menus and not able to retrieve menus using
wp_get_nav_menu_items
--------------------------+---------------------------------------
 Reporter:  huskyr        |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Menus         |     Version:  6.0
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:  administration, template
--------------------------+---------------------------------------

Comment (by huskyr):

 Answering my own bug here: it seems this went wrong because i had a
 {{{pre_get_posts}}} action that set the {{{post_type}}} to a custom type
 for every query. Adding a {{{$query->is_main_query()}}} to that action
 fixed it. I'm still unsure why this did work in <6.0 versions.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/55893#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list