NavMenuLinks
in package
Uses
UtilsProvider
Custom navigation menu links for the legal links.
Table of Contents
Constants
- META_SUCCESS_MESSAGE_FIELD_ID = 'rcb-menu-item-success-message'
- META_SUCCESS_MESSAGE_META_NAME = 'rcb-success-message'
- METABOX_ID = 'rcb-nav-menu'
- NAVIGATION_ITEM_ID = 'rcb-nav-item'
Methods
- addLinksToMenu() : true|WP_Error
- Add existing links to our current menu.
- admin_head() : mixed
- Register new metabox.
- customize_controls_head() : mixed
- Output script to hide the "URL" input field in customizer.
- getLinkElements() : mixed
- Get the available link elements.
- getPluginConstantPrefix() : string
- Get the prefix of this plugin so composer packages can dynamically build other constant values on it.
- instance() : mixed
- New instance.
- isMenuItem() : mixed
- Check if a given object of a menu item is a `NavMenuLinkItem`.
- nav_menu_link_attributes() : mixed
- Add the custom meta fields to the output navigation element.
- nav_menu_metabox() : mixed
- Print the metabox.
- register_customize_nav_menu_item_types() : mixed
- Register custom item types in customizer.
- register_customize_nav_menu_items() : mixed
- Register custom item type links in customizer.
- revisionCurrent() : mixed
- Get a list of available navigation menus so we can add a automatic "addition" process to our "Legal links" section.
- wp_nav_menu_item_custom_fields() : mixed
- Add custom meta fields to the nav menu field.
- wp_setup_nav_menu_item() : mixed
- Correct "Custom link" to "Real Cookie Banner" type label.
- wp_update_nav_menu_item() : mixed
- Save custom meta fields.
- __construct() : mixed
- C'tor.
Constants
META_SUCCESS_MESSAGE_FIELD_ID
public
mixed
META_SUCCESS_MESSAGE_FIELD_ID
= 'rcb-menu-item-success-message'
META_SUCCESS_MESSAGE_META_NAME
public
mixed
META_SUCCESS_MESSAGE_META_NAME
= 'rcb-success-message'
METABOX_ID
public
mixed
METABOX_ID
= 'rcb-nav-menu'
NAVIGATION_ITEM_ID
public
mixed
NAVIGATION_ITEM_ID
= 'rcb-nav-item'
Methods
addLinksToMenu()
Add existing links to our current menu.
public
addLinksToMenu(string $nav_menu_id) : true|WP_Error
Parameters
- $nav_menu_id : string
Return values
true|WP_Erroradmin_head()
Register new metabox.
public
admin_head() : mixed
customize_controls_head()
Output script to hide the "URL" input field in customizer.
public
customize_controls_head() : mixed
getLinkElements()
Get the available link elements.
public
getLinkElements([bool $onlyLinks = false ][, string $language = null ]) : mixed
Parameters
- $onlyLinks : bool = false
- $language : string = null
getPluginConstantPrefix()
Get the prefix of this plugin so composer packages can dynamically build other constant values on it.
public
getPluginConstantPrefix() : string
Tags
Return values
stringinstance()
New instance.
public
static instance() : mixed
Tags
isMenuItem()
Check if a given object of a menu item is a `NavMenuLinkItem`.
public
isMenuItem(WP_Post $menu_item) : mixed
Parameters
- $menu_item : WP_Post
nav_menu_link_attributes()
Add the custom meta fields to the output navigation element.
public
nav_menu_link_attributes(array<string|int, mixed> $atts, WP_Post $item) : mixed
Parameters
- $atts : array<string|int, mixed>
- $item : WP_Post
nav_menu_metabox()
Print the metabox.
public
nav_menu_metabox() : mixed
register_customize_nav_menu_item_types()
Register custom item types in customizer.
public
register_customize_nav_menu_item_types(array<string|int, mixed> $item_types) : mixed
Parameters
- $item_types : array<string|int, mixed>
-
Menu item types.
register_customize_nav_menu_items()
Register custom item type links in customizer.
public
register_customize_nav_menu_items([array<string|int, mixed> $items = [] ][, string $type = '' ][, string $object = '' ][, int $page = 0 ]) : mixed
Parameters
- $items : array<string|int, mixed> = []
- $type : string = ''
- $object : string = ''
- $page : int = 0
revisionCurrent()
Get a list of available navigation menus so we can add a automatic "addition" process to our "Legal links" section.
public
revisionCurrent(array<string|int, mixed> $arr) : mixed
Parameters
- $arr : array<string|int, mixed>
wp_nav_menu_item_custom_fields()
Add custom meta fields to the nav menu field.
public
wp_nav_menu_item_custom_fields(int $item_id, object $item) : mixed
Parameters
- $item_id : int
- $item : object
wp_setup_nav_menu_item()
Correct "Custom link" to "Real Cookie Banner" type label.
public
wp_setup_nav_menu_item(WP_Post $menu_item) : mixed
Parameters
- $menu_item : WP_Post
wp_update_nav_menu_item()
Save custom meta fields.
public
wp_update_nav_menu_item(int $menu_id, int $menu_item_db_id, array<string|int, mixed> $args) : mixed
Parameters
- $menu_id : int
- $menu_item_db_id : int
- $args : array<string|int, mixed>
__construct()
C'tor.
private
__construct() : mixed