PHP Class Timber\Menu

Inheritance: extends Core
Exibir arquivo Open project: jarednova/timber

Public Properties

Property Type Description
$ID
$MenuItemClass
$PostClass
$id integer the ID# of the menu, corresponding to the wp_terms table
$items TimberMenuItem[] | null you need to iterate through
$name string of the menu (ex: Main Navigation)
$term_id integer
$title string

Public Methods

Method Description
__construct ( integer | string $slug )
find_parent_item_in_menu ( array $menu_items, integer $parent_id ) : TimberMenuItem | null
get_items ( ) : array

Protected Methods

Method Description
get_menu_id_from_locations ( string $slug, array $locations ) : integer
get_menu_id_from_terms ( integer $slug ) : integer
init ( integer $menu_id )
init_as_page_menu ( )
order_children ( array $items ) : array

Method Details

__construct() public method

public __construct ( integer | string $slug )
$slug integer | string

find_parent_item_in_menu() public method

public find_parent_item_in_menu ( array $menu_items, integer $parent_id ) : TimberMenuItem | null
$menu_items array
$parent_id integer
return TimberMenuItem | null

get_items() public method

public get_items ( ) : array
return array

get_menu_id_from_locations() protected method

protected get_menu_id_from_locations ( string $slug, array $locations ) : integer
$slug string
$locations array
return integer

get_menu_id_from_terms() protected method

protected get_menu_id_from_terms ( integer $slug ) : integer
$slug integer
return integer

init() protected method

protected init ( integer $menu_id )
$menu_id integer

init_as_page_menu() protected method

protected init_as_page_menu ( )

order_children() protected method

protected order_children ( array $items ) : array
$items array
return array

Property Details

$ID public_oe property

public $ID

$MenuItemClass public_oe property

public $MenuItemClass

$PostClass public_oe property

public $PostClass

$id public_oe property

the ID# of the menu, corresponding to the wp_terms table
public int $id
return integer

$items public_oe property

you need to iterate through
public TimberMenuItem[]|null $items
return TimberMenuItem[] | null

$name public_oe property

of the menu (ex: Main Navigation)
public string $name
return string

$term_id public_oe property

public int $term_id
return integer

$title public_oe property

public string $title
return string