用于生成自定义文章类型的注册代码骨架文件。
适合在开发主题或插件时快速创建文章类型注册文件,支持指定标签、文本域、图标等参数。
| 参数 | 说明 |
|---|---|
<slug> |
文章类型的内部名称。 |
[--label=<label>] |
用于翻译更新消息的文本。 |
[--textdomain=<textdomain>] |
用于标签的文本域。 |
[--dashicon=<dashicon>] |
菜单中使用的dashicon。 |
[--theme] |
在活动主题目录中创建文件,而不是发送到STDOUT。使用--theme=<theme>指定主题。 |
[--plugin=<plugin>] |
在给定插件目录中创建文件,而不是发送到STDOUT。 |
[--raw] |
仅生成register_post_type()调用,不包含其他内容。 |
[--force] |
覆盖已存在的文件。 |
$ wp scaffold post-type movie --label=Movie --theme=simple-life