Trait_Menu_Integration
Trait for integrating with WordPress menus.
Table of Contents
Methods
- get_menu_id_by_location() : int|null
- Returns the ID of a menu assigned to a specified location.
- render_menu_by_location() : void
- Renders a menu by menu location.
- get_menu_choices() : array<string|int, mixed>
- Returns all WordPress menu locations for use in ACF select fields.
Methods
get_menu_id_by_location()
Returns the ID of a menu assigned to a specified location.
public
get_menu_id_by_location(string $location) : int|null
Parameters
- $location : string
-
The menu location.
Return values
int|null —The menu id. Null If menu cannot be found.
render_menu_by_location()
Renders a menu by menu location.
public
render_menu_by_location(string $location[, array<string|int, mixed> $args = array() ]) : void
Parameters
- $location : string
-
The menu location.
- $args : array<string|int, mixed> = array()
-
(optional) An array of arguments for rendering the menu.
Tags
get_menu_choices()
Returns all WordPress menu locations for use in ACF select fields.
protected
get_menu_choices() : array<string|int, mixed>