WordPress开发者和主题制作者的搜索引擎



is_nav_menu_item ›

Since3.0.0
已弃用n/a
is_nav_menu_item ( $menu_item_id = 0 )
参数:
  • (int) $menu_item_id The ID of the potential nav menu item.
    Required: No
    默认:
返回:
  • (bool) Whether the given ID is that of a nav menu item.
定义在:
文档:

Determines whether the given ID is a nav menu item.



源码

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