Remove --n parameter, use positional argument instead.

This commit is contained in:
Jay Wood 2017-02-24 13:08:56 -05:00
parent c0eb00dc28
commit ec12e4f17f
2 changed files with 5 additions and 7 deletions

View file

@ -98,6 +98,7 @@ IF this is set, and the site is multi-site enabled. A switch to blog occurs to
### 1.2 ### 1.2
* Fixed - [#6](https://github.com/JayWood/jw-wpcli-random-posts/issues/6) - Error message duplication * Fixed - [#6](https://github.com/JayWood/jw-wpcli-random-posts/issues/6) - Error message duplication
* Changed - `posts` command to `generate` - makes more sense.
### 1.1 ### 1.1
* Fixed possible bug with `post_type_exists` checks on multisite installs. * Fixed possible bug with `post_type_exists` checks on multisite installs.

View file

@ -169,6 +169,9 @@ if ( defined( 'WP_CLI' ) && WP_CLI ) {
* *
* ## OPTIONS * ## OPTIONS
* *
* <number>
* : The number of posts to generate
*
* [--type=<posttype>] * [--type=<posttype>]
* : The post type * : The post type
* --- * ---
@ -181,12 +184,6 @@ if ( defined( 'WP_CLI' ) && WP_CLI ) {
* default: publish * default: publish
* --- * ---
* *
* [--n=<int>]
* : The number of posts to generate
* ---
* default: 1
* ---
*
* [--tax=<taxonomy>] * [--tax=<taxonomy>]
* : The taxonomies to tie to the post. * : The taxonomies to tie to the post.
* --- * ---
@ -248,7 +245,7 @@ if ( defined( 'WP_CLI' ) && WP_CLI ) {
$post_type = isset( $assoc_args['type'] ) ? $assoc_args['type'] : 'post'; $post_type = isset( $assoc_args['type'] ) ? $assoc_args['type'] : 'post';
$featured_image = isset( $assoc_args['featured-image'] ) ? true : false; $featured_image = isset( $assoc_args['featured-image'] ) ? true : false;
$number_posts = isset( $assoc_args['n'] ) ? intval( $assoc_args['n'] ) : 1; $number_posts = isset( $args[ 0 ] ) ? intval( $args[ 0 ] ) : 1;
$taxonomies = isset( $assoc_args['tax'] ) ? explode( ',', $assoc_args['tax'] ) : array(); $taxonomies = isset( $assoc_args['tax'] ) ? explode( ',', $assoc_args['tax'] ) : array();
$term_count = isset( $assoc_args['tax-n'] ) ? intval( $assoc_args['tax-n'] ) : 3; $term_count = isset( $assoc_args['tax-n'] ) ? intval( $assoc_args['tax-n'] ) : 3;
$post_author = isset( $assoc_args['author'] ) ? intval( $assoc_args['author'] ) : 1; $post_author = isset( $assoc_args['author'] ) ? intval( $assoc_args['author'] ) : 1;