I want to get a list of all nav menu items displayed in a menu having id "19" in my search page to match against the search string.
I would like to get names of menu items as displayed on frontend. I have managed to get the list of nav items through sql given below, but couldn't get all names, only custom label names are available in result object. Please advise.
SELECT p.*
FROM wp_posts AS p
LEFT JOIN wp_term_relationships AS tr ON tr.object_id = p.ID
LEFT JOIN wp_term_taxonomy AS tt ON tt.term_taxonomy_id = tr.term_taxonomy_id
WHERE p.post_type = 'nav_menu_item'
AND tt.term_id =19
Aucun commentaire:
Enregistrer un commentaire