register_acpt_post_type

register_acpt_post_type

Register a new custom post type.

Usage

register_acpt_post_type([ 
    'post_name' => 'cpt', 
    'singular_label' => 'New CPT', 
    'plural_label' => 'New CPTs', 
    'icon' => 'admin-appearance',
    'supports' => [ 
        'title',
        'editor', 
        'comments', 
        'revisions', 
        'trackbacks', 
        'author', 
        'excerpt',
    ], 
    'labels' => [], 
    'settings' => [], 
]);

Parameters

  • post_name (string) (Required) The post name

  • singular_label (string) (Required) The post singular label

  • plural_label (string) (Required) The plural label

  • icon (string) (Required) The admin icon (see dashicon list)

  • supports (array) (Required) Refer to official documentation

  • labels (array) (Required) Refer to official documentation

  • settings (array) (Required) Refer to official documentation

Return

  • boolean

Last updated