is_nav_menu_item()

最后更新于:2021-11-27 09:17:04

is_nav_menu_item( int$menu_item_id)

Determines whether the given ID is a nav menu item.

参数

$menu_item_id

(int) (Required) The ID of the potential nav menu item.

响应

(bool) Whether the given ID is that of a nav menu item.

源文件

文件: gc-includes/nav-menu.php

function is_nav_menu_item( $menu_item_id = 0 ) {
	return ( ! is_gc_error( $menu_item_id ) && ( 'nav_menu_item' === get_post_type( $menu_item_id ) ) );
}