Wp wc product attribute update

Uit De Vliegende Brigade
Naar navigatie springen Naar zoeken springen

Pas de definitie van een taxonomie aan. De truuk is, dat je met de flag aangeeft, welk veld je wilt aanpassen, gevolgd door de nieuwe waarde

wp help wc product_attribute update

NAME

  wp wc product_attribute update

DESCRIPTION

  Update an existing item.

SYNOPSIS

  wp wc product_attribute update <id> [--id=<id>] [--name=<name>] [--slug=<slug>] [--type=<type>]
  [--order_by=<order_by>] [--has_archives=<has_archives>] [--porcelain]

OPTIONS

  <id>
    The ID for the resource.

  [--id=<id>]
    Unique identifier for the resource.

  [--name=<name>]
    Attribute name.

  [--slug=<slug>]
    An alphanumeric identifier for the resource unique to its type.

  [--type=<type>]
    Type of attribute.

  [--order_by=<order_by>]
    Default sort order.

  [--has_archives=<has_archives>]
    Enable/Disable attribute archives.

  [--porcelain]
    Output just the id when the operation is successful.

Voorbeeld

In dit voorbeeld wordt de naam aangepast. Merk op dat de slug automatisch meeverandert.

$ wp wc product_attribute get 29 --user=4

+--------------+-------------+
| Field        | Value       |
+--------------+-------------+
| id           | 29          |
| name         | Apparaat    |
| slug         | pa_apparaat |
| type         | select      |
| order_by     | menu_order  |
| has_archives | true        |
+--------------+-------------+


$ wp wc product_attribute update 29 --user=4 --name="Device"

Success: Updated product_attribute 29.


$ wp wc product_attribute get 29 --user=4

+--------------+------------+
| Field        | Value      |
+--------------+------------+
| id           | 29         |
| name         | Device     |
| slug         | pa_device  |
| type         | select     |
| order_by     | menu_order |
| has_archives | false      |
+--------------+------------+

Meerdere updates tegelijkertijd

Je kunt meerdere aspecten tegelijkertijd bijwerken. Bv:

wp wc product_attribute update 29 --user=4 --name="Device" --has_archives=1