Timber\Menu::get_menu_id_from_locations PHP Метод

get_menu_id_from_locations() защищенный Метод

protected get_menu_id_from_locations ( string $slug, array $locations ) : integer
$slug string
$locations array
Результат integer
    protected function get_menu_id_from_locations($slug, $locations)
    {
        if ($slug === 0) {
            $slug = $this->get_menu_id_from_terms($slug);
        }
        if (is_numeric($slug)) {
            $slug = array_search($slug, $locations);
        }
        if (isset($locations[$slug])) {
            $menu_id = $locations[$slug];
            return $menu_id;
        }
    }