From e84d1e22ccb613528f8d863e0d8380db37d82bbb Mon Sep 17 00:00:00 2001 From: jmslbam Date: Mon, 5 Aug 2013 23:54:35 +0200 Subject: [PATCH] Move `--post_types` to taxonomy function Because a CPT doesn't need this arg. --- php/commands/scaffold.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/php/commands/scaffold.php b/php/commands/scaffold.php index 13541038..af10af5f 100644 --- a/php/commands/scaffold.php +++ b/php/commands/scaffold.php @@ -90,9 +90,13 @@ class Scaffold_Command extends WP_CLI_Command { function taxonomy( $args, $assoc_args ) { $defaults = array( 'textdomain' => '', - 'post_types' => 'post' + 'post_types' => "'post'" ); + if( isset($assoc_args['post_types']) ) { + $assoc_args['post_types'] = $this->quote_comma_list_elements( $assoc_args['post_types'] ); + } + $this->_scaffold( $args[0], $assoc_args, $defaults, '/taxonomies/', array( 'taxonomy.mustache', 'taxonomy_extended.mustache' @@ -107,15 +111,12 @@ class Scaffold_Command extends WP_CLI_Command { 'theme' => false, 'plugin' => false, 'raw' => false, - 'post_types' => false, ) ); $vars = $this->extract_args( $assoc_args, $defaults ); $vars['slug'] = $slug; - $vars['post_types'] = $this->quote_comma_list_elements( $control_args['post_types'] ); - $vars['textdomain'] = $this->get_textdomain( $vars['textdomain'], $control_args ); $vars['label'] = $control_args['label']; -- 2.11.0