scaffold-command/templates/post_type.mustache
2024-06-11 17:54:23 +05:45

45 lines
2.7 KiB
Text

register_post_type(
'{{slug}}',
array(
'labels' => array(
'name' => __( '{{label_plural_ucfirst}}', '{{textdomain}}' ),
'singular_name' => __( '{{label_ucfirst}}', '{{textdomain}}' ),
'all_items' => __( 'All {{label_plural_ucfirst}}', '{{textdomain}}' ),
'archives' => __( '{{label_ucfirst}} Archives', '{{textdomain}}' ),
'attributes' => __( '{{label_ucfirst}} Attributes', '{{textdomain}}' ),
'insert_into_item' => __( 'Insert into {{label}}', '{{textdomain}}' ),
'uploaded_to_this_item' => __( 'Uploaded to this {{label}}', '{{textdomain}}' ),
'featured_image' => _x( 'Featured Image', '{{slug}}', '{{textdomain}}' ),
'set_featured_image' => _x( 'Set featured image', '{{slug}}', '{{textdomain}}' ),
'remove_featured_image' => _x( 'Remove featured image', '{{slug}}', '{{textdomain}}' ),
'use_featured_image' => _x( 'Use as featured image', '{{slug}}', '{{textdomain}}' ),
'filter_items_list' => __( 'Filter {{label_plural}} list', '{{textdomain}}' ),
'items_list_navigation' => __( '{{label_plural_ucfirst}} list navigation', '{{textdomain}}' ),
'items_list' => __( '{{label_plural_ucfirst}} list', '{{textdomain}}' ),
'new_item' => __( 'New {{label_ucfirst}}', '{{textdomain}}' ),
'add_new' => __( 'Add New', '{{textdomain}}' ),
'add_new_item' => __( 'Add New {{label_ucfirst}}', '{{textdomain}}' ),
'edit_item' => __( 'Edit {{label_ucfirst}}', '{{textdomain}}' ),
'view_item' => __( 'View {{label_ucfirst}}', '{{textdomain}}' ),
'view_items' => __( 'View {{label_plural_ucfirst}}', '{{textdomain}}' ),
'search_items' => __( 'Search {{label_plural}}', '{{textdomain}}' ),
'not_found' => __( 'No {{label_plural}} found', '{{textdomain}}' ),
'not_found_in_trash' => __( 'No {{label_plural}} found in trash', '{{textdomain}}' ),
'parent_item_colon' => __( 'Parent {{label_ucfirst}}:', '{{textdomain}}' ),
'menu_name' => __( '{{label_plural_ucfirst}}', '{{textdomain}}' ),
),
'public' => true,
'hierarchical' => false,
'show_ui' => true,
'show_in_nav_menus' => true,
'supports' => array( 'title', 'editor' ),
'has_archive' => true,
'rewrite' => true,
'query_var' => true,
'menu_position' => null,
'menu_icon' => 'dashicons-{{dashicon}}',
'show_in_rest' => true,
'rest_base' => '{{slug}}',
'rest_controller_class' => 'WP_REST_Posts_Controller',
)
);