Wp option add (WP-CLI)

Uit De Vliegende Brigade
Versie door Jeroen Strompf (overleg | bijdragen) op 29 jul 2022 om 08:18
(wijz) ← Oudere versie | Huidige versie (wijz) | Nieuwere versie → (wijz)
Naar navigatie springen Naar zoeken springen

Adds a new option value.

$wp help option add

NAME

  wp option add

DESCRIPTION

  Adds a new option value.

SYNOPSIS

  wp option add <key> [<value>] [--format=<format>] [--autoload=<autoload>]

  Errors if the option already exists.

OPTIONS

  <key>
    The name of the option to add.

  [<value>]
    The value of the option to add. If ommited, the value is read from STDIN.

  [--format=<format>]
    The serialization format for the value.
    ---
    default: plaintext
    options:
      - plaintext
      - json
    ---

  [--autoload=<autoload>]
    Should this option be automatically loaded.
    ---
    options:
      - 'yes'
      - 'no'
    ---

EXAMPLES

    # Create an option by reading a JSON file.
    $ wp option add my_option --format=json < config.json
    Success: Added 'my_option' option.

Zie ook