PHP Класс Menu_Command, wp-cli

## EXAMPLES # Create a new menu $ wp menu create "My Menu" Success: Created menu 200. # List existing menus $ wp menu list +---------+----------+----------+-----------+-------+ | term_id | name | slug | locations | count | +---------+----------+----------+-----------+-------+ | 200 | My Menu | my-menu | | 0 | | 177 | Top Menu | top-menu | primary | 7 | +---------+----------+----------+-----------+-------+ # Create a new menu link item $ wp menu item add-custom my-menu Apple http://apple.com --porcelain 1922 # Assign the 'my-menu' menu to the 'primary' location $ wp menu location assign my-menu primary Success: Assigned location to menu.
Наследование: extends WP_CLI_Command
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$obj_fields
$obj_type

Открытые методы

Метод Описание
create ( $args, $assoc_args ) Create a new menu.
delete ( $args, $_ ) Delete one or more menus.
list_ ( $_, $assoc_args ) Get a list of menus.

Защищенные методы

Метод Описание
get_formatter ( &$assoc_args )

Описание методов

create() публичный Метод

## OPTIONS : A descriptive name for the menu. [--porcelain] : Output just the new menu id. ## EXAMPLES $ wp menu create "My Menu" Success: Created menu 200.
public create ( $args, $assoc_args )

delete() публичный Метод

## OPTIONS ... : The name, slug, or term ID for the menu(s). ## EXAMPLES $ wp menu delete "My Menu" Success: 1 menu deleted.
public delete ( $args, $_ )

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

protected get_formatter ( &$assoc_args )

list_() публичный Метод

## OPTIONS [--fields=] : Limit the output to specific object fields. [--format=] : Render output in a particular format. --- default: table options: - table - csv - json - count - ids - yaml --- ## AVAILABLE FIELDS These fields will be displayed by default for each menu: * term_id * name * slug * count These fields are optionally available: * term_group * term_taxonomy_id * taxonomy * description * parent * locations ## EXAMPLES $ wp menu list +---------+----------+----------+-----------+-------+ | term_id | name | slug | locations | count | +---------+----------+----------+-----------+-------+ | 200 | My Menu | my-menu | | 0 | | 177 | Top Menu | top-menu | primary | 7 | +---------+----------+----------+-----------+-------+
public list_ ( $_, $assoc_args )

Описание свойств

$obj_fields защищенное свойство

protected $obj_fields

$obj_type защищенное свойство

protected $obj_type