-
Notifications
You must be signed in to change notification settings - Fork 0
CommandCreatePostType
rogertm edited this page Apr 8, 2026
·
2 revisions
Crea una clase de Custom Post Type usando stubs y la configuración actual.
create:post_type [options] [--] <name> [<project>]-
nameNombre del CPT (ej:"Book"). -
projectSlug del proyecto destino (ej:wasp-child). Si se omite, usawasp.
-
--dry-runSimula la creación sin escribir archivos. -
-h, --helpMuestra la ayuda.
Plugin actual:
php cli/wasp create:post_type "Book"En un child plugin:
php cli/wasp create:post_type "Book" "wasp-child"Simulación:
php cli/wasp create:post_type "Book" --dry-run- Crea
classes/post-type/class-{project}-post-type-book.php.- Ejemplo en WASP:
wasp/classes/post-type/class-wasp-post-type-book.php
- Ejemplo en WASP:
- Agrega en
inc/classes.php:
new {Namespace}\Post_Type\Post_Type_Book;class Post_Type_Book extends Post_Type
{
public function __construct()
{
$this->post_type = 'wasp-book';
}
}