OSDN Git Service

Accept a parent when creating a new term
authorDaniel Bachhuber <d@danielbachhuber.com>
Mon, 4 Feb 2013 02:40:19 +0000 (18:40 -0800)
committerDaniel Bachhuber <d@danielbachhuber.com>
Sat, 9 Feb 2013 23:02:49 +0000 (15:02 -0800)
man-src/term-create.txt
php/commands/term.php

index 19fe84d..31ca3a4 100644 (file)
 
        A description for the new term.
 
+* `--parent`=<parent>:
+
+       A parent for the new term.
+
 ## EXAMPLES
 
        wp term create Apple category --description="A type of fruit"
\ No newline at end of file
index d6c9ffb..888ef2d 100644 (file)
@@ -40,7 +40,7 @@ class Term_Command extends WP_CLI_Command {
        /**
         * Create a term.
         *
-        * @synopsis <term> <taxonomy> [--slug=<slug>] [--description=<description>]
+        * @synopsis <term> <taxonomy> [--slug=<slug>] [--description=<description>] [--parent=<parent>]
         */
        public function create( $args, $assoc_args ) {
 
@@ -49,6 +49,7 @@ class Term_Command extends WP_CLI_Command {
                $defaults = array(
                                'slug'            => sanitize_title( $term ),
                                'description'     => '',
+                               'parent'          => '',
                        );
                $assoc_args = wp_parse_args( $assoc_args, $defaults );