post_types.add
/ Utility / post_types.add
It allows us to register custom post types for WordPress. It is a shorter alternative for more detailed register.post shortcode.
It takes the following parameters
main: the post type slug you want to register
singular_label: the Singular Name for the post type.
plural_label: the Plural Name for the post type.
desc: Description of why or what this post type does.
Here is how to register a public post type
1 |
[post_types.add test_works singular_name='Testing CPT' plural_name='TESTINGS' /] |
and to register a private post type we can use
1 |
[post_types.add.private test_works singular_name='Testing CPT' plural_name='TESTINGS' /] |
It sets the following parameters while registering the post type
1 2 3 4 5 6 7 8 9 10 11 |
'show_in_nav_menus'=>false, 'show_ui' => true, 'show_in_menu' => true, 'capability_type' => 'post', 'map_meta_cap' => true, 'hierarchical' => false, 'query_var' => false, 'menu_icon'=>'dashicons-archive', 'supports' => array('title','editor','revisions','thumbnail','custom-fields'), 'rewrite' => false, 'delete_with_user' => false, |
Important: You can only use this shortcode in the register module of Awesome Core.