• hi all i am looking for wp_nav_item title and post_name. when i select the post_name with this query it shows me id’s and i also search these id’s in wp_postmeta but not success. i want to get menu label or menu title. if any one know how to get it. please help ASAP. thanx.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Ghulam Ali

    (@ghulamali2612)

    sorry i forgot to add query this is my query
    SELECT
    wp.ID,
    wp.post_title,
    wp.post_type,
    wp.post_name
    FROM “.$prefix.”posts AS wp
    WHERE wp.post_status = ‘publish’
    AND post_type = ‘nav_menu_item’
    ORDER BY wp.post_type desc”,ARRAY_A

    Moderator bcworkz

    (@bcworkz)

    Sorry for the late reply, I only just now saw your topic.

    Where the menu title resides depends on what type of menu item you have. For example, with a simple link, the menu item post_title is the actual title. In the case of a menu item for a Page, the page ID is stored in the menu item’s postmeta under ‘_menu_item_object_id’. The default menu title is the post_title of the _menu_item_object_id. However, if you edit the menu title, it is stored just as is done for a simple link, the menu item post_title.

    In general, if not the menu item’s post_title, then the post_title of the ID found in postmeta. There is likely other variations I’m unaware of, but these two places are good places to start looking.

    BTW, the post_name is the menu title slug from the initial label or the post ID of the menu item (depending on menu item type). Once assigned, it never changes regardless of what label you choose.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Get Menus title’ is closed to new replies.