diff --git a/README.md b/README.md index f1e15ff..57c8053 100644 --- a/README.md +++ b/README.md @@ -98,6 +98,7 @@ IF this is set, and the site is multi-site enabled. A switch to blog occurs to ### 1.2 * 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 * Fixed possible bug with `post_type_exists` checks on multisite installs. diff --git a/generate-posts.php b/generate-posts.php index 94c4c1a..4554571 100644 --- a/generate-posts.php +++ b/generate-posts.php @@ -169,6 +169,9 @@ if ( defined( 'WP_CLI' ) && WP_CLI ) { * * ## OPTIONS * + * + * : The number of posts to generate + * * [--type=] * : The post type * --- @@ -181,12 +184,6 @@ if ( defined( 'WP_CLI' ) && WP_CLI ) { * default: publish * --- * - * [--n=] - * : The number of posts to generate - * --- - * default: 1 - * --- - * * [--tax=] * : 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'; $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(); $term_count = isset( $assoc_args['tax-n'] ) ? intval( $assoc_args['tax-n'] ) : 3; $post_author = isset( $assoc_args['author'] ) ? intval( $assoc_args['author'] ) : 1;