Wp sidebar (WP-CLI)

Uit De Vliegende Brigade
Naar navigatie springen Naar zoeken springen

wp sidebar lists registered sidebars. Dit commando kent maar één subcommando. Het komt wellicht van pas als je gebruik wilt maken van wp widget:

$wp help sidebar

NAME

  wp sidebar

DESCRIPTION

  Lists registered sidebars.

SYNOPSIS

  wp sidebar <command>

SUBCOMMANDS

  list      Lists registered sidebars.

  A [sidebar][1] is any widgetized area of your theme.

  ---
  [1] https://developer.wordpress.org/themes/functionality/sidebars/

EXAMPLES

    # List sidebars
    $ wp sidebar list --fields=name,id --format=csv
    name,id
    "Widget Area",sidebar-1
    "Inactive Widgets",wp_inactive_widgets

Voorbeeld

wp sidebar list

+---------------------+---------------------+----------------------------------------------------------------------------+
| name                | id                  | description                                                                |
+---------------------+---------------------+----------------------------------------------------------------------------+
| Primary Widget Area | sidebar-1           |                                                                            |
| Header Widget Area  | mini-cart-widget    |                                                                            |
| Inactive Widgets    | wp_inactive_widgets | Drag widgets here to remove them from the sidebar but keep their settings. |
+---------------------+---------------------+----------------------------------------------------------------------------+