_nav_menu_item_id_use_once

The timeline below displays how wordpress function _nav_menu_item_id_use_once has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 5.5

/**
 * Prevents a menu item ID from being used more than once.
 *
 * @since 3.0.1
 * @access private
 *
 * @param string $id
 * @param object $item
 * @return string
 */
function _nav_menu_item_id_use_once($id, $item)
{
    static $_used_ids = array();
    if (in_array($item->ID, $_used_ids, true)) {
        return '';
    }
    $_used_ids[] = $item->ID;
    return $id;
}

WordPress Version: 4.3

/**
 * Prevents a menu item ID from being used more than once.
 *
 * @since 3.0.1
 * @access private
 *
 * @staticvar array $used_ids
 * @param string $id
 * @param object $item
 * @return string
 */
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;
}

WordPress Version: 3.7

/**
 * Prevents a menu item ID from being used more than once.
 *
 * @since 3.0.1
 * @access private
 */
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;
}