Skip to content

Latest commit

 

History

History
121 lines (61 loc) · 2.02 KB

Menu_Item.md

File metadata and controls

121 lines (61 loc) · 2.02 KB

Menu_Item

Class that represent a menu item. You usually don't have to create this by yourself, but by calling functions like WPS::menu('primary').

Example

	$menuItem = new \WPS\Menu_Item($wp_post);

Author : Olivier Bossel olivier.bossel@gmail.com https://olivierbossel.com

Constructor

Construct the object using the wp_post passed menu item

Parameters

Name Type Description Status Default
$wp_post { WP_Post } The wp_post menu item required

Example

	$wpsMenuItem = new \WPS\Menu_Item($wp_post);

Author : Olivier Bossel olivier.bossel@gmail.com https://olivierbossel.com

Public

Public properties

$id

The menu item id

Type : { Integer }

Public

Default : null

$url

THe menu item url

Type : { String }

Public

Default : null

$title

The menu item title

Type : { String }

Public

Default : null

$attr_title

The menu item title attribute

Type : { String }

Public

Default : null

$target

The menu item target

Type : { String }

Public

Default : null

$description

The menu item description

Type : { String }

Public

Default : null

$classes

The meni item classes

Type : { Array }

Public

Default : []

$items

The menu item sub items

Type : { Array }

Public

Default : []