Wp menu list (WP-CLI)

Uit De Vliegende Brigade
Versie door Jeroen Strompf (overleg | bijdragen) op 27 aug 2022 om 17:50 (Nieuwe pagina aangemaakt met '<pre> $ wp help menu list NAME wp menu list DESCRIPTION Gets a list of menus. SYNOPSIS wp menu list [--fields=<fields>] [--format=<format>] OPTIONS...')
(wijz) ← Oudere versie | Huidige versie (wijz) | Nieuwere versie → (wijz)
Naar navigatie springen Naar zoeken springen
$ wp help menu list

NAME

  wp menu list

DESCRIPTION

  Gets a list of menus.

SYNOPSIS

  wp menu list [--fields=<fields>] [--format=<format>]

OPTIONS

  [--fields=<fields>]
    Limit the output to specific object fields.

  [--format=<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     |
    +---------+----------+----------+-----------+-------+

Example

$ wp menu list

+---------+-------------------------+-------------------------+----------------------+-------+
| term_id | name                    | slug                    | locations            | count |
+---------+-------------------------+-------------------------+----------------------+-------+
| 17      | Main menu               | main-menu               | primary              | 56    |
| 1646    | Mobile Bottom Menu      | mobile-bottom-menu      | mobile-bottom,footer | 7     |
| 1645    | Mobile Top Menu         | mobile-top-menu         | mobile-top           | 12    |
| 22      | Product categories menu | product-categories-menu | product_categories   | 1     |
| 44753   | Utility menu            | utility-menu            | utility              | 1     |
+---------+-------------------------+-------------------------+----------------------+-------+