Skip to content

Commit 764bd8f

Browse files
Add new command to README
1 parent 291122b commit 764bd8f

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3111,6 +3111,27 @@ wp post update <id>... [--post_author=<post_author>] [--post_date=<post_date>] [
31113111

31123112

31133113

3114+
### wp post url-to-id
3115+
3116+
Gets the post ID for a given URL.
3117+
3118+
~~~
3119+
wp post url-to-id <url>
3120+
~~~
3121+
3122+
**OPTIONS**
3123+
3124+
<url>
3125+
The URL of the post to get.
3126+
3127+
**EXAMPLES**
3128+
3129+
# Get post ID by URL
3130+
$ wp post url-to-id https://example.com/?p=1
3131+
1
3132+
3133+
3134+
31143135
### wp post-type
31153136

31163137
Retrieves details on the site's registered post types.

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@
115115
"post term remove",
116116
"post term set",
117117
"post update",
118+
"post url-to-id",
118119
"post-type",
119120
"post-type get",
120121
"post-type list",

src/Post_Command.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -879,7 +879,7 @@ public function generate( $args, $assoc_args ) {
879879
}
880880

881881
/**
882-
* Gets post ID by URL.
882+
* Gets the post ID for a given URL.
883883
*
884884
* ## OPTIONS
885885
*
@@ -890,6 +890,7 @@ public function generate( $args, $assoc_args ) {
890890
*
891891
* # Get post ID by URL
892892
* $ wp post url-to-id https://example.com/?p=1
893+
* 1
893894
*
894895
* @subcommand url-to-id
895896
*/

0 commit comments

Comments
 (0)