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.
Показать файл
Открыть проект
Защищенные свойства (Protected)
Открытые методы
Метод |
Описание |
|
create ( $args, $assoc_args ) |
Create a new menu. |
|
delete ( $args, $_ ) |
Delete one or more menus. |
|
list_ ( $_, $assoc_args ) |
Get a list of menus. |
|
Защищенные методы
Описание методов
## 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 ) |
## OPTIONS
## 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 защищенное свойство
$obj_type защищенное свойство