Skip to content

Commit 7ba6b69

Browse files
committed
Update documentation
1 parent eed3f0c commit 7ba6b69

File tree

3 files changed

+40
-4
lines changed

3 files changed

+40
-4
lines changed

README.md

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2177,12 +2177,42 @@ wp post edit <id>
21772177

21782178

21792179

2180+
### wp post exists
2181+
2182+
Verifies whether a post exists.
2183+
2184+
~~~
2185+
wp post exists <id>
2186+
~~~
2187+
2188+
Displays a success message if the post does exist.
2189+
2190+
**OPTIONS**
2191+
2192+
<id>
2193+
The ID of the post to check.
2194+
2195+
**EXAMPLES**
2196+
2197+
# The post exists.
2198+
$ wp post exists 1
2199+
Success: Post with ID 1337 exists.
2200+
$ echo $?
2201+
0
2202+
2203+
# The post does not exist.
2204+
$ wp post exists 10000
2205+
$ echo $?
2206+
1
2207+
2208+
2209+
21802210
### wp post generate
21812211

21822212
Generates some posts.
21832213

21842214
~~~
2185-
wp post generate [--count=<number>] [--post_type=<type>] [--post_status=<status>] [--post_title=<post_title>] [--post_author=<login>] [--post_date=<yyyy-mm-dd-hh-ii-ss>] [--post_content] [--max_depth=<number>] [--format=<format>]
2215+
wp post generate [--count=<number>] [--post_type=<type>] [--post_status=<status>] [--post_title=<post_title>] [--post_author=<login>] [--post_date=<yyyy-mm-dd-hh-ii-ss>] [--post_date_gmt=<yyyy-mm-dd-hh-ii-ss>] [--post_content] [--max_depth=<number>] [--format=<format>]
21862216
~~~
21872217

21882218
Creates a specified number of new posts with dummy data.
@@ -2222,6 +2252,9 @@ Creates a specified number of new posts with dummy data.
22222252
[--post_date=<yyyy-mm-dd-hh-ii-ss>]
22232253
The date of the generated posts. Default: current date
22242254

2255+
[--post_date_gmt=<yyyy-mm-dd-hh-ii-ss>]
2256+
The GMT date of the generated posts. Default: value of post_date (or current date if it's not set)
2257+
22252258
[--post_content]
22262259
If set, the command reads the post_content from STDIN.
22272260

@@ -5469,7 +5502,7 @@ wp user unspam <id>...
54695502
Updates an existing user.
54705503

54715504
~~~
5472-
wp user update <user>... [--user_pass=<password>] [--user_nicename=<nice_name>] [--user_url=<url>] [--user_email=<email>] [--display_name=<display_name>] [--nickname=<nickname>] [--first_name=<first_name>] [--last_name=<last_name>] [--description=<description>] [--rich_editing=<rich_editing>] [--user_registered=<yyyy-mm-dd-hh-ii-ss>] [--role=<role>] --<field>=<value>
5505+
wp user update <user>... [--user_pass=<password>] [--user_nicename=<nice_name>] [--user_url=<url>] [--user_email=<email>] [--display_name=<display_name>] [--nickname=<nickname>] [--first_name=<first_name>] [--last_name=<last_name>] [--description=<description>] [--rich_editing=<rich_editing>] [--user_registered=<yyyy-mm-dd-hh-ii-ss>] [--role=<role>] --<field>=<value> [--skip-email]
54735506
~~~
54745507

54755508
**OPTIONS**
@@ -5516,6 +5549,9 @@ wp user update <user>... [--user_pass=<password>] [--user_nicename=<nice_name>]
55165549
--<field>=<value>
55175550
One or more fields to update. For accepted fields, see wp_update_user().
55185551

5552+
[--skip-email]
5553+
Don't send an email notification to the user.
5554+
55195555
**EXAMPLES**
55205556

55215557
# Update user

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@
9191
"post create",
9292
"post delete",
9393
"post edit",
94+
"post exists",
9495
"post generate",
9596
"post get",
9697
"post list",

src/Post_Command.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -897,7 +897,7 @@ private function get_tags( $post_id ) {
897897
return $tag_arr;
898898
}
899899

900-
/*
900+
/**
901901
* Verifies whether a post exists.
902902
*
903903
* Displays a success message if the post does exist.
@@ -919,7 +919,6 @@ private function get_tags( $post_id ) {
919919
* $ wp post exists 10000
920920
* $ echo $?
921921
* 1
922-
*
923922
*/
924923
public function exists( $args ) {
925924
if ( $this->fetcher->get( $args[0] ) ) {

0 commit comments

Comments
 (0)