OSDN Git Service

Changed filename from machinename to slug
authorJaime Martinez <jmslbam@gmail.com>
Wed, 6 Feb 2013 17:16:42 +0000 (18:16 +0100)
committerJaime Martinez <jmslbam@gmail.com>
Wed, 6 Feb 2013 17:16:42 +0000 (18:16 +0100)
Because `wp scaffold post-type jm-foo` scaffolds a file name jm_foo.php bacause the machinename hyphens get replaced by underscores.
Same behaviour as the plugin scaffold.

Hyphens should separate words.

php/commands/scaffold.php

index 0061ac5..0637854 100644 (file)
@@ -121,7 +121,7 @@ class Scaffold_Command extends WP_CLI_Command {
                }
 
                if ( $path = $this->get_output_path( $control_args, $subdir ) ) {
-                       $filename = $path . $machine_name .'.php';
+                       $filename = $path . $slug .'.php';
 
                        $this->create_file( $filename, $final_output );