Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
95 changes: 95 additions & 0 deletions src/Comment_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,51 @@ public function __construct() {
*
* ## OPTIONS
*
* [--comment_agent=<comment_agent>]
* : The HTTP user agent of the comment author.
*
* [--comment_approved=<comment_approved>]
* : Whether the comment has been approved. Default 1.
*
* [--comment_author=<comment_author>]
* : The name of the author of the comment.
*
* [--comment_author_email=<comment_author_email>]
* : The email address of the comment author.
*
* [--comment_author_IP=<comment_author_IP>]
* : The IP address of the comment author.
*
* [--comment_author_url=<comment_author_url>]
* : The URL address of the comment author.
*
* [--comment_content=<comment_content>]
* : The content of the comment.
*
* [--comment_date=<yyyy-mm-dd-hh-ii-ss>]
* : The date the comment was submitted.
*
* [--comment_date_gmt=<yyyy-mm-dd-hh-ii-ss>]
* : The date the comment was submitted in the GMT timezone.
*
* [--comment_karma=<comment_karma>]
* : The karma of the comment. Default 0.
*
* [--comment_parent=<comment_parent>]
* : ID of this comment's parent, if any. Default 0.
*
* [--comment_post_ID=<comment_post_ID>]
* : ID of the post that relates to the comment, if any.
*
* [--comment_type=<comment_type>]
* : Comment type. Default 'comment'.
*
* [--comment_meta=<comment_meta>]
* : Array in JSON format of comment meta values keyed by their comment meta key.
*
* [--user_id=<user_id>]
* : ID of the user who submitted the comment. Default 0.
*
* [--<field>=<value>]
* : Associative args for the new comment. See wp_insert_comment().
*
Expand All @@ -100,6 +145,8 @@ public function __construct() {
* @param array<string, mixed> $assoc_args Associative arguments.
*/
public function create( $args, $assoc_args ) {
$assoc_args = Utils\parse_shell_arrays( $assoc_args, [ 'comment_meta' ] );

$assoc_args = wp_slash( $assoc_args );
parent::_create(
$args,
Expand Down Expand Up @@ -137,6 +184,52 @@ function ( $params ) {
* <id>...
* : One or more IDs of comments to update.
*
* [--comment_agent=<comment_agent>]
* : The HTTP user agent of the comment author.
*
* [--comment_approved=<comment_approved>]
* : Whether the comment has been approved.
*
* [--comment_author=<comment_author>]
* : The name of the author of the comment.
*
* [--comment_author_email=<comment_author_email>]
* : The email address of the comment author.
*
* [--comment_author_IP=<comment_author_IP>]
* : The IP address of the comment author.
*
* [--comment_author_url=<comment_author_url>]
* : The URL address of the comment author.
*
* [--comment_content=<comment_content>]
* : The content of the comment.
*
* [--comment_date=<yyyy-mm-dd-hh-ii-ss>]
* : The date the comment was submitted.
*
* [--comment_date_gmt=<yyyy-mm-dd-hh-ii-ss>]
* : The date the comment was submitted in the GMT timezone. Note that
* wp_update_comment() always recalculates this from 'comment_date'.
*
* [--comment_karma=<comment_karma>]
* : The karma of the comment.
*
* [--comment_parent=<comment_parent>]
* : ID of this comment's parent, if any.
*
* [--comment_post_ID=<comment_post_ID>]
* : ID of the post that relates to the comment, if any.
*
* [--comment_type=<comment_type>]
* : Comment type.
*
* [--comment_meta=<comment_meta>]
* : Array in JSON format of comment meta values keyed by their comment meta key.
*
* [--user_id=<user_id>]
* : ID of the user who submitted the comment.
*
* --<field>=<value>
* : One or more fields to update. See wp_update_comment().
*
Expand All @@ -150,6 +243,8 @@ function ( $params ) {
* @param array<string, mixed> $assoc_args Associative arguments.
*/
public function update( $args, $assoc_args ) {
$assoc_args = Utils\parse_shell_arrays( $assoc_args, [ 'comment_meta' ] );

$assoc_args = wp_slash( $assoc_args );
parent::_update(
$args,
Expand Down
10 changes: 10 additions & 0 deletions src/Post_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,13 @@ public function __construct() {
* [--meta_input=<meta_input>]
* : Array in JSON format of post meta values keyed by their post meta key. Default empty.
*
* [--page_template=<page_template>]
* : Page template to use.
*
* [--import_id=<import_id>]
* : The post ID to be used when inserting a new post. If specified, must not
* match any existing post ID.
*
* [<file>]
* : Read post content from <file>. If this value is present, the
* `--post_content` argument will be ignored.
Expand Down Expand Up @@ -338,6 +345,9 @@ function ( $params ) {
* [--meta_input=<meta_input>]
* : Array in JSON format of post meta values keyed by their post meta key. Default empty.
*
* [--page_template=<page_template>]
* : Page template to use.
*
* [<file>]
* : Read post content from <file>. If this value is present, the
* `--post_content` argument will be ignored.
Expand Down
4 changes: 2 additions & 2 deletions src/User_Application_Password_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,8 @@ public function create( $args, $assoc_args ) {
* <uuid>
* : The universally unique ID of the application password.
*
* [--<field>=<value>]
* : Update the <field> with a new <value>. Currently supported fields: name.
* [--name=<name>]
* : The new name of the application password.
*
* ## EXAMPLES
*
Expand Down
32 changes: 32 additions & 0 deletions src/User_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -538,12 +538,42 @@ public function create( $args, $assoc_args ) {
* [--rich_editing=<rich_editing>]
* : A string for whether to enable the rich editor or not. False if not empty.
*
* [--syntax_highlighting=<syntax_highlighting>]
* : Whether to enable the rich code editor for the user. Accepts 'true' or
* 'false' as a string literal, not boolean.
*
* [--comment_shortcuts=<comment_shortcuts>]
* : Whether to enable comment moderation keyboard shortcuts for the user.
* Accepts 'true' or 'false' as a string literal, not boolean.
*
* [--admin_color=<admin_color>]
* : Admin color scheme for the user.
*
* [--use_ssl=<use_ssl>]
* : Whether the user should always access the admin over https.
*
* [--user_registered=<yyyy-mm-dd-hh-ii-ss>]
* : The date the user registered.
*
* [--user_activation_key=<user_activation_key>]
* : Password reset key.
*
* [--spam=<spam>]
* : Multisite only. Whether the user is marked as spam.
*
* [--show_admin_bar_front=<show_admin_bar_front>]
* : Whether to display the admin bar for the user on the site's front end.
* Accepts 'true' or 'false' as a string literal, not boolean.
*
* [--role=<role>]
* : A string used to set the user's role.
*
* [--locale=<locale>]
* : The user's locale.
*
* [--meta_input=<meta_input>]
* : Array in JSON format of user meta values keyed by their user meta key.
*
* --<field>=<value>
* : One or more fields to update. For accepted fields, see wp_update_user().
*
Expand Down Expand Up @@ -584,6 +614,8 @@ public function update( $args, $assoc_args ) {
add_filter( 'send_password_change_email', '__return_false' );
}

$assoc_args = Utils\parse_shell_arrays( $assoc_args, [ 'meta_input' ] );

$assoc_args = wp_slash( $assoc_args );
parent::_update( $user_ids, $assoc_args, 'wp_update_user' );

Expand Down