Skip to content

Commit 95b7bca

Browse files
Merge pull request #40 from Sidsector9/master
Added examples for updating options
2 parents c49f386 + dcd1820 commit 95b7bca

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

src/Option_Command.php

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,18 @@ class Option_Command extends WP_CLI_Command {
5151
* $ wp option get home
5252
* http://example.com
5353
*
54+
* # Get blog description.
55+
* $ wp option get blogdescription
56+
* A random blog description
57+
*
58+
* # Get blog name
59+
* $ wp option get blogname
60+
* A random blog name
61+
*
62+
* # Get admin email.
63+
* $ wp option get admin_email
64+
65+
*
5466
* # Get option in JSON format.
5567
* $ wp option get active_plugins --format=json
5668
* {"0":"dynamically-dynamic-sidebar\/dynamically-dynamic-sidebar.php","1":"monster-widget\/monster-widget.php","2":"show-current-template\/show-current-template.php","3":"theme-check\/theme-check.php","5":"wordpress-importer\/wordpress-importer.php"}
@@ -314,6 +326,26 @@ public function list_( $args, $assoc_args ) {
314326
* Success: Updated 'my_option' option.
315327
* Success: Updated 'my_option' option.
316328
*
329+
* # Update site blog name.
330+
* $ wp option update blogname "Random blog name"
331+
* Success: Updated 'blogname' option.
332+
*
333+
* # Update site blog description.
334+
* $ wp option update blogdescription "Some random blog description"
335+
* Success: Updated 'blogdescription' option.
336+
*
337+
* # Update admin email address.
338+
* $ wp option update admin_email [email protected]
339+
* Success: Updated 'admin_email' option.
340+
*
341+
* # Set the default role.
342+
* $ wp option update default_role author
343+
* Success: Updated 'default_role' option.
344+
*
345+
* # Set the timezone string.
346+
* $ wp option update timezone_string "America/New_York"
347+
* Success: Updated 'timezone_string' option.
348+
*
317349
* @alias set
318350
*/
319351
public function update( $args, $assoc_args ) {

0 commit comments

Comments
 (0)