Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #374 : Add examples for wp option patch command #375

Merged
merged 5 commits into from
Sep 29, 2022
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions src/Option_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,32 @@ function( $key ) {
* - plaintext
* - json
* ---
*
* ## EXAMPLES
*
* # Patch insert.
BhargavBhandari90 marked this conversation as resolved.
Show resolved Hide resolved
* $ wp option patch insert option_name foo bar
* Success: Updated 'option_name' option.
*
* # Patch Update.
BhargavBhandari90 marked this conversation as resolved.
Show resolved Hide resolved
* $ wp option patch update option_name foo new
* Success: Updated 'option_name' option.
*
* # Patch Update using patch file.
* $ wp option patch update option_name foo bar < patch
* Success: Updated 'option_name' option.
*
* # Patch Update when no key found.
* $ wp option patch update option_name foo not-a-key new-value
* Error: No data exists for key "not-a-key"
*
* # Patch Update when don't pass all necessary argumants.
* $ wp option patch update option_name foo
* Error: Please provide value to update.
*
* # Patch delete.
* $ wp option patch delete option_name foo bar
* Success: Updated 'option_name' option.
*/
public function patch( $args, $assoc_args ) {
list( $action, $key ) = $args;
Expand Down