Skip to content

Commit b992a09

Browse files
Regenerate README file - 2022-09-29 (#376)
Co-authored-by: Alain Schlesser <[email protected]>
1 parent 9689134 commit b992a09

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1887,6 +1887,32 @@ wp option patch <action> <key> <key-path>... [<value>] [--format=<format>]
18871887
- json
18881888
---
18891889

1890+
**EXAMPLES**
1891+
1892+
# Add 'bar' to the 'foo' key on an option with name 'option_name'
1893+
$ wp option patch insert option_name foo bar
1894+
Success: Updated 'option_name' option.
1895+
1896+
# Update the value of 'foo' key to 'new' on an option with name 'option_name'
1897+
$ wp option patch update option_name foo new
1898+
Success: Updated 'option_name' option.
1899+
1900+
# Set nested value of 'bar' key to value we have in the patch file on an option with name 'option_name'.
1901+
$ wp option patch update option_name foo bar < patch
1902+
Success: Updated 'option_name' option.
1903+
1904+
# Update the value for the key 'not-a-key' which is not exist on an option with name 'option_name'.
1905+
$ wp option patch update option_name foo not-a-key new-value
1906+
Error: No data exists for key "not-a-key"
1907+
1908+
# Update the value for the key 'foo' without passing value on an option with name 'option_name'.
1909+
$ wp option patch update option_name foo
1910+
Error: Please provide value to update.
1911+
1912+
# Delete the nested key 'bar' under 'foo' key on an option with name 'option_name'.
1913+
$ wp option patch delete option_name foo bar
1914+
Success: Updated 'option_name' option.
1915+
18901916

18911917

18921918
### wp option pluck

0 commit comments

Comments
 (0)