[DevOps] WP 플러그인/테마 Title * Options Secret Author * Password * Content Visual Text <span style="font-family: arial, helvetica, sans-serif;"><br><br><br><br><hr style="border-top: dotted 1px;" />Parent Title : <b>wp-cli scaffold</b><br>Author : changhee1220<br>Created Date : 24-02-17 09:57 / Last Updated Date : 24-12-09 11:36<br><hr style="border-top: dotted 1px;" />The <code>wp scaffold</code> command is part of WP-CLI, which is a command-line interface for WordPress. It allows you to generate boilerplate code for themes, plugins, child themes, post types, taxonomies, and more, helping you speed up your development process. To use any <code>wp scaffold</code> commands, you first need to have WP-CLI installed on your system. Here's a quick overview of some of the common scaffolding commands you might find useful: <h3 id="scaffold-a-plugin">Scaffold a Plugin</h3> To generate the basic files needed for a WordPress plugin: <code>bash wp scaffold plugin <plugin-name></code> Replace <code><plugin-name></code> with the desired name of your plugin. This will create a new plugin directory with a PHP file containing the plugin header, a readme file, and optionally, tests and GitHub configuration. <img src="http://fdcs.delphizon.com/wp-content/uploads/2024/12/uploaded_image-16.png" /> <h3 id="scaffold-a-theme">Scaffold a Theme</h3> To generate a new <em>underscores-based</em> theme: <code>bash wp scaffold _s <theme-name> --theme_name="<Theme Name>" --author="<Author Name>"</code> Replace <code><theme-name></code>, <code><Theme Name></code>, and <code><Author Name></code> with your desired theme directory name, theme name, and author name respectively. This command creates a basic underscores theme with the specified parameters. <h3> </h3> <h3 id="scaffold-child-theme">Scaffold Child Theme</h3> To create a child theme: <code>bash wp scaffold child-theme <child-theme-name> --parent_theme=<parent-theme-slug></code> Ensure you replace <code><child-theme-name></code> with your desired child theme name and <code><parent-theme-slug></code> with the slug of the parent theme. <h3> </h3> <h3 id="scaffold-custom-post-type">Scaffold Custom Post Type</h3> To quickly generate PHP code that registers a custom post type: <code>bash wp scaffold post-type <custom-post-type-name></code> Replace <code><custom-post-type-name></code> with the name of your custom post type. This command will output the necessary PHP code, which you can then copy into your theme's <code>functions.php</code> file or into a plugin. <h3> </h3> <h3 id="scaffold-taxonomy">Scaffold Taxonomy</h3> Similarly, to generate code for a custom taxonomy: <code>bash wp scaffold taxonomy <custom-taxonomy-name> --post_types=<post-type></code> Replace <code><custom-taxonomy-name></code> with your taxonomy name and <code><post-type></code> with the post type to associate this taxonomy with. This will give you the PHP code to register a custom taxonomy. <h3> </h3> <h3 id="before-you-start">Before You Start</h3> Before running any <code>wp scaffold</code> commands, make sure you're in the root directory of your WordPress installation in your terminal or command prompt. This is where the <code>wp-config.php</code> file is located. WP-CLI and its scaffolding capabilities can greatly accelerate your theme and plugin development by generating boilerplate code that adheres to WordPress coding standards. For more details and options available for each scaffolding command, you can run <code>wp help scaffold <command></code> in your terminal to get specific help for each command (replace <code><command></code> with <code>plugin</code>, <code>theme</code>, etc.). If you have any specific scaffolding needs or questions, feel free to ask!<br> Photos KBoard Add Media Thumbnail WP Search Public Only title (secret document) Exclusion Back Save