Uses
Uses | Description |
---|---|
wp-includes/post.php: get_post_type() | Retrieves the post type of the current post or of a given post. |
wp-includes/load.php: is_wp_error() | Check whether variable is a WordPress Error. |
Determines whether the given ID is a nav menu item.
(int) (Required) The ID of the potential nav menu item.
(bool) Whether the given ID is that of a nav menu item.
File: wp-includes/nav-menu.php
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 ) ) ); }
Version | Description |
---|---|
3.0.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/is_nav_menu_item