Wp option update (WP-CLI): verschil tussen versies
Naar navigatie springen
Naar zoeken springen
Regel 47: | Regel 47: | ||
== Voorbeelden == | == Voorbeelden == | ||
+ | |||
+ | Bijwerken bestaande velden: | ||
<pre> | <pre> | ||
Regel 52: | Regel 54: | ||
wp option update blogdescription "$slogan" # Tagline | wp option update blogdescription "$slogan" # Tagline | ||
</pre> | </pre> | ||
+ | |||
+ | Bijwerken niet-bestaand veld: | ||
== Zie ook == | == Zie ook == |
Versie van 29 jul 2022 08:32
wp option update
: Update an option value. When the option doesn't exist, it will be created (without warning or error):
$ wp help option update NAME wp option update DESCRIPTION Updates an option value. SYNOPSIS wp option update <key> [<value>] [--autoload=<autoload>] [--format=<format>] ALIAS set OPTIONS <key> The name of the option to update. [<value>] The new value. If ommited, the value is read from STDIN. [--autoload=<autoload>] Requires WP 4.2. Should this option be automatically loaded. --- options: - 'yes' - 'no' --- [--format=<format>] The serialization format for the value. --- default: plaintext options: - plaintext - json ---
Voorbeelden
Bijwerken bestaande velden:
wp option update blogname "$site_title" # Site title wp option update blogdescription "$slogan" # Tagline
Bijwerken niet-bestaand veld: