Skip to content

Commit 2122839

Browse files
Regenerate README file (#74)
Co-authored-by: Alain Schlesser <alain.schlesser@gmail.com>
1 parent 8048b0c commit 2122839

1 file changed

Lines changed: 53 additions & 0 deletions

File tree

README.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,59 @@ new sidebar.
206206

207207

208208

209+
### wp widget patch
210+
211+
Updates a nested value in a widget's options.
212+
213+
~~~
214+
wp widget patch <action> <widget-id> <key-path>... [<value>] [--format=<format>]
215+
~~~
216+
217+
**OPTIONS**
218+
219+
<action>
220+
Patch action to perform.
221+
---
222+
options:
223+
- insert
224+
- update
225+
- delete
226+
---
227+
228+
<widget-id>
229+
Unique ID for the widget.
230+
231+
<key-path>...
232+
The name(s) of the keys within the value to locate the value to patch.
233+
234+
[<value>]
235+
The new value. If omitted, the value is read from STDIN.
236+
237+
[--format=<format>]
238+
The serialization format for the value.
239+
---
240+
default: plaintext
241+
options:
242+
- plaintext
243+
- json
244+
---
245+
246+
**EXAMPLES**
247+
248+
# Update a nested value in the options of the archives-1 widget
249+
$ wp widget patch update archives-1 title "My Archives"
250+
Success: Widget updated.
251+
252+
# Insert a new nested value into the options of the archives-1 widget
253+
$ wp widget patch insert archives-1 new_key "New Value"
254+
Success: Widget updated.
255+
256+
# Delete a nested value from the options of the archives-1 widget
257+
$ wp widget patch delete archives-1 title
258+
Success: Widget updated.
259+
260+
261+
209262
### wp widget reset
210263

211264
Resets sidebar.

0 commit comments

Comments
 (0)