Menus aren’t stored in options. They are linked quite complicatedly so through various other tables.
$wpdb->get_results(sprintf("
select tr.object_id from wp_terms t
left join wp_term_taxonomy tt on t.term_id = tt.term_id
left join wp_term_relationships tr on tt.term_taxonomy_id = tr.term_taxonomy_id
left join wp_posts p on p.ID=tr.object_id
left join wp_postmeta m on m.post_id=tr.object_id
where t.slug ='%s' and tt.taxonomy='nav_menu' group by(ID)
order by p.menu_order asc LIMIT 200;
",$menu));
where $menu is the slug of the menu such as main, footer or whatever you may have called it.
The query outlines the relationships that you have to account for.
Related Posts:
- function deactivate_plugins does not exist
- what’s the meaning of the field wp_capabilities in table wp_usermeta
- What is wrong with using add_option with Multisite instead of add_blog_option in a plugin
- Is there widely accepted phpDoc syntax for documenting which hook calls a function?
- Make Categories and Tags required in admin
- Getting wrong relationship value in $args in wp_Query?
- wp_schedule_event in a class
- custom XMLRPC method plus authentication of user & WooCommerce order
- How to extend LINK TO functionality in ATTACHMENT DISPLAY SETTINGS
- How do I Make a Theme “plugin-ready”?
- How to iterate through custom posts and add the title to an array
- WordPress Terminology Options Vs. Settings
- How to modify post content before writing to database?
- Display only certain posts based on visitor’s country?
- Custom user profile, registration, login page with theme
- Plugin Sidebar is not Saving Meta Attribute to Post/Page after “Update”
- Possible to preset a widget’s contents via a plugin script?
- $wp_filesystem returns NULL. What are the dependencies?
- How to allow Unfiltered HTML in a wordpress multisite install
- Rewrite Point Doesn’t Work on Custom Taxonomy
- Best way for plugin to accept POSTs?
- wp_remote_get keeps timing out
- What are the really difference writing WordPress 3.x widget plugins?
- Error “Call to a member function switch_to_locale() on null” during insert_with_markers
- multiple functions with same filter
- Calling plugins API within a theme
- How do you output enqueued scripts to an admin page?
- Woocommerce – Hide a Column in Cart Table
- Does WordPress’s HTTP API use any caching?
- query users by role
- call_user_func_array() expects parameter 1 to be a valid callback, array must have exactly two members
- How to Create Custom HTML Tag on Editor in `Text(HTML)` mode
- null callback in add_settings_section
- Should shorcodes in i18n plugins be translated and if so, how?
- Is there a Filter that I can use to filter the tags before they are inserted in to the database?
- How long should it take for a plugin to fully load into the WordPress.org plugin repository?
- Which directory in my plugin repo does WordPress Plugin Directory package?
- How can I pass get_the_author_meta(‘user_email’) through the REST API?
- get post attachment using ajax
- Replace default Blogroll Links with Social Media Links
- Append varible to url or set session
- Adding custom end points, No error line
- How to enqueue or include json file to a plugin
- Search and Filter
- Trying to code a simple plugin, infinite loop?
- Update own Plugin Repository on Multisite
- Custom Plugin theme filter
- How to exit a plugin’s execution mid-stream?
- Issue with contextual help overwriting existing content
- Inserting code to HTML view from a pop up initiated from visual view
- CSS not affecting widget output
- Using a custom shortcode from within the template of a shortcode plugin
- enqueue script/style plungin development
- Trying to get class to instantiate ONCE (or, “why do I keep punching myself in the head?”)
- How to create a WordPress Plugin that has it’s own “page”?
- Plugin Development – Class Constructor Not Firing wp_enqueue_style action hook
- How to Add a Custom Size for Thumbnails for WP – Gallery
- Create Widget or Enable Shortcodes in Sidebar
- Conditional Generation of Image Sizes using add_image_size
- Plugins and caching
- WordPress publish_post hook not getting featured image and meta on first publish, but works on updating title
- Add function after the_content
- Display time difference (6 hours ago) in a Soliloquy caption
- How to add custom view links to wp-admin/post.php?
- Empty Array is Giving Warning for array_merge()
- how to create category with code in wordpress using form
- How do I get variables from my plugin’s settings page?
- Get post thumbnail in WP_Query
- How To Protect Plugin Display From Being Affected By Theme’s CSS
- Is it possible to have instead mypage.com/?page_id=81 to have mypage.com/cool/?
- User Data Handling between two plugins
- Translations only load from `wp-content/languages/plugins` but not from the plugin’s languages folder
- Woocommerce place order update shipping price
- wp_schedule_event not executing function call, even with add_action
- How to query a nested field in wordpress api using _fields param
- function add custom fields to media gallery
- ajax response strips multidimensional array and unable to decode
- Multiple instances of $opt_name in redux framework
- Using AJAX to submit and return data inside the WordPress Plugin Boiler Plate framework
- Add quick edit functionnality to plugin table
- The Events Calendar featured image as body background?
- using wordpress acf shortcods in tables goes outside the table
- Pass javascript result to shortcode executer function
- remove different admin menu for specific users
- Not able to Update database while creating a custom module
- How to load css file after a certain css file
- Shortcode from a plugin not working
- Plugins and how to assign urls to content
- Deactivate Other Incompatible Plugin Upon Activation
- How to make auto installer Plugin?
- Can’t get query string in ajax call
- Cannot echo a JS variable to a jQuery plugin coming from wp_localize_script
- first_name property missing inside register_user action hook
- Pass results of custom query to loop – when writing a plugin
- How do I use (or mimic) document.getElementById() on a page loaded from WordPress database?
- user can login from single account detail from multiple locations(computer) at the same time [closed]
- WP Cron registers hook without any action (does not call the function)
- Need someone to help you want to manage points for members to code interface functions? thank you
- WordPress plugin boilerplate AJAX functionality
- Run different permission_callback depending on HTTP method of custom REST API endpoint