Skip to content

Commit d0b3d13

Browse files
swissspidyclaude
andauthored
Document all accepted fields for the catch-all write commands (#636)
Co-authored-by: Claude Opus 5 <noreply@anthropic.com> Co-authored-by: Claude <noreply@anthropic.com>
1 parent 18b7dc1 commit d0b3d13

4 files changed

Lines changed: 139 additions & 2 deletions

File tree

‎src/Comment_Command.php‎

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,51 @@ public function __construct() {
8080
*
8181
* ## OPTIONS
8282
*
83+
* [--comment_agent=<comment_agent>]
84+
* : The HTTP user agent of the comment author.
85+
*
86+
* [--comment_approved=<comment_approved>]
87+
* : Whether the comment has been approved. Default 1.
88+
*
89+
* [--comment_author=<comment_author>]
90+
* : The name of the author of the comment.
91+
*
92+
* [--comment_author_email=<comment_author_email>]
93+
* : The email address of the comment author.
94+
*
95+
* [--comment_author_IP=<comment_author_IP>]
96+
* : The IP address of the comment author.
97+
*
98+
* [--comment_author_url=<comment_author_url>]
99+
* : The URL address of the comment author.
100+
*
101+
* [--comment_content=<comment_content>]
102+
* : The content of the comment.
103+
*
104+
* [--comment_date=<yyyy-mm-dd-hh-ii-ss>]
105+
* : The date the comment was submitted.
106+
*
107+
* [--comment_date_gmt=<yyyy-mm-dd-hh-ii-ss>]
108+
* : The date the comment was submitted in the GMT timezone.
109+
*
110+
* [--comment_karma=<comment_karma>]
111+
* : The karma of the comment. Default 0.
112+
*
113+
* [--comment_parent=<comment_parent>]
114+
* : ID of this comment's parent, if any. Default 0.
115+
*
116+
* [--comment_post_ID=<comment_post_ID>]
117+
* : ID of the post that relates to the comment, if any.
118+
*
119+
* [--comment_type=<comment_type>]
120+
* : Comment type. Default 'comment'.
121+
*
122+
* [--comment_meta=<comment_meta>]
123+
* : Array in JSON format of comment meta values keyed by their comment meta key.
124+
*
125+
* [--user_id=<user_id>]
126+
* : ID of the user who submitted the comment. Default 0.
127+
*
83128
* [--<field>=<value>]
84129
* : Associative args for the new comment. See wp_insert_comment().
85130
*
@@ -100,6 +145,8 @@ public function __construct() {
100145
* @param array<string, mixed> $assoc_args Associative arguments.
101146
*/
102147
public function create( $args, $assoc_args ) {
148+
$assoc_args = Utils\parse_shell_arrays( $assoc_args, [ 'comment_meta' ] );
149+
103150
$assoc_args = wp_slash( $assoc_args );
104151
parent::_create(
105152
$args,
@@ -137,6 +184,52 @@ function ( $params ) {
137184
* <id>...
138185
* : One or more IDs of comments to update.
139186
*
187+
* [--comment_agent=<comment_agent>]
188+
* : The HTTP user agent of the comment author.
189+
*
190+
* [--comment_approved=<comment_approved>]
191+
* : Whether the comment has been approved.
192+
*
193+
* [--comment_author=<comment_author>]
194+
* : The name of the author of the comment.
195+
*
196+
* [--comment_author_email=<comment_author_email>]
197+
* : The email address of the comment author.
198+
*
199+
* [--comment_author_IP=<comment_author_IP>]
200+
* : The IP address of the comment author.
201+
*
202+
* [--comment_author_url=<comment_author_url>]
203+
* : The URL address of the comment author.
204+
*
205+
* [--comment_content=<comment_content>]
206+
* : The content of the comment.
207+
*
208+
* [--comment_date=<yyyy-mm-dd-hh-ii-ss>]
209+
* : The date the comment was submitted.
210+
*
211+
* [--comment_date_gmt=<yyyy-mm-dd-hh-ii-ss>]
212+
* : The date the comment was submitted in the GMT timezone. Note that
213+
* wp_update_comment() always recalculates this from 'comment_date'.
214+
*
215+
* [--comment_karma=<comment_karma>]
216+
* : The karma of the comment.
217+
*
218+
* [--comment_parent=<comment_parent>]
219+
* : ID of this comment's parent, if any.
220+
*
221+
* [--comment_post_ID=<comment_post_ID>]
222+
* : ID of the post that relates to the comment, if any.
223+
*
224+
* [--comment_type=<comment_type>]
225+
* : Comment type.
226+
*
227+
* [--comment_meta=<comment_meta>]
228+
* : Array in JSON format of comment meta values keyed by their comment meta key.
229+
*
230+
* [--user_id=<user_id>]
231+
* : ID of the user who submitted the comment.
232+
*
140233
* --<field>=<value>
141234
* : One or more fields to update. See wp_update_comment().
142235
*
@@ -150,6 +243,8 @@ function ( $params ) {
150243
* @param array<string, mixed> $assoc_args Associative arguments.
151244
*/
152245
public function update( $args, $assoc_args ) {
246+
$assoc_args = Utils\parse_shell_arrays( $assoc_args, [ 'comment_meta' ] );
247+
153248
$assoc_args = wp_slash( $assoc_args );
154249
parent::_update(
155250
$args,

‎src/Post_Command.php‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,13 @@ public function __construct() {
127127
* [--meta_input=<meta_input>]
128128
* : Array in JSON format of post meta values keyed by their post meta key. Default empty.
129129
*
130+
* [--page_template=<page_template>]
131+
* : Page template to use.
132+
*
133+
* [--import_id=<import_id>]
134+
* : The post ID to be used when inserting a new post. If specified, must not
135+
* match any existing post ID.
136+
*
130137
* [<file>]
131138
* : Read post content from <file>. If this value is present, the
132139
* `--post_content` argument will be ignored.
@@ -338,6 +345,9 @@ function ( $params ) {
338345
* [--meta_input=<meta_input>]
339346
* : Array in JSON format of post meta values keyed by their post meta key. Default empty.
340347
*
348+
* [--page_template=<page_template>]
349+
* : Page template to use.
350+
*
341351
* [<file>]
342352
* : Read post content from <file>. If this value is present, the
343353
* `--post_content` argument will be ignored.

‎src/User_Application_Password_Command.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -388,8 +388,8 @@ public function create( $args, $assoc_args ) {
388388
* <uuid>
389389
* : The universally unique ID of the application password.
390390
*
391-
* [--<field>=<value>]
392-
* : Update the <field> with a new <value>. Currently supported fields: name.
391+
* [--name=<name>]
392+
* : The new name of the application password.
393393
*
394394
* ## EXAMPLES
395395
*

‎src/User_Command.php‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -538,12 +538,42 @@ public function create( $args, $assoc_args ) {
538538
* [--rich_editing=<rich_editing>]
539539
* : A string for whether to enable the rich editor or not. False if not empty.
540540
*
541+
* [--syntax_highlighting=<syntax_highlighting>]
542+
* : Whether to enable the rich code editor for the user. Accepts 'true' or
543+
* 'false' as a string literal, not boolean.
544+
*
545+
* [--comment_shortcuts=<comment_shortcuts>]
546+
* : Whether to enable comment moderation keyboard shortcuts for the user.
547+
* Accepts 'true' or 'false' as a string literal, not boolean.
548+
*
549+
* [--admin_color=<admin_color>]
550+
* : Admin color scheme for the user.
551+
*
552+
* [--use_ssl=<use_ssl>]
553+
* : Whether the user should always access the admin over https.
554+
*
541555
* [--user_registered=<yyyy-mm-dd-hh-ii-ss>]
542556
* : The date the user registered.
543557
*
558+
* [--user_activation_key=<user_activation_key>]
559+
* : Password reset key.
560+
*
561+
* [--spam=<spam>]
562+
* : Multisite only. Whether the user is marked as spam.
563+
*
564+
* [--show_admin_bar_front=<show_admin_bar_front>]
565+
* : Whether to display the admin bar for the user on the site's front end.
566+
* Accepts 'true' or 'false' as a string literal, not boolean.
567+
*
544568
* [--role=<role>]
545569
* : A string used to set the user's role.
546570
*
571+
* [--locale=<locale>]
572+
* : The user's locale.
573+
*
574+
* [--meta_input=<meta_input>]
575+
* : Array in JSON format of user meta values keyed by their user meta key.
576+
*
547577
* --<field>=<value>
548578
* : One or more fields to update. For accepted fields, see wp_update_user().
549579
*
@@ -584,6 +614,8 @@ public function update( $args, $assoc_args ) {
584614
add_filter( 'send_password_change_email', '__return_false' );
585615
}
586616

617+
$assoc_args = Utils\parse_shell_arrays( $assoc_args, [ 'meta_input' ] );
618+
587619
$assoc_args = wp_slash( $assoc_args );
588620
parent::_update( $user_ids, $assoc_args, 'wp_update_user' );
589621

0 commit comments

Comments
 (0)