A WordPress-centric search engine for devs and theme authors



_nav_menu_item_id_use_once ›

Since3.0.1
Deprecatedn/a
_nav_menu_item_id_use_once ( $id, $item )
Access:
  • private
Parameters: (2)
  • (string) $id
    Required: Yes
  • (object) $item
    Required: Yes
Returns:
  • (string)
Defined at:
Codex:

Prevents a menu item ID from being used more than once.



Source

function _nav_menu_item_id_use_once( $id, $item ) {
	static $_used_ids = array();
	if ( in_array( $item->ID, $_used_ids ) ) {
		return '';
	}
	$_used_ids[] = $item->ID;
	return $id;
}