register.post
/ Utility / register.post
This is shortcode is used to register custom post types with more control then post_types.add shortcode.
Parameters
It has just one parameter, and the rest of the configuration is passed as JSON block as shown below.
slug: It is used to specify the post type you want to register.
Important: This shortcode can only be used in ‘register‘ module of the awesome core.
Example of using register.post shortcode to register custom post types.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
[template.set singular_label='Form Entry' /] [template.set plural_label='Form Entries' /] [register.post slug='as_entries'] { "label" : "[template.get plural_label /]", "public" : true, "exclude_from_search":true, "publicly_queryable":true, "show_in_nav_menus":false, "show_ui" : true, "show_in_menu" : true, "capability_type" : "post", "map_meta_cap" : true, "rewrite" : {"slug":"entry_type", "with_front":false }, "hierarchical" : false, "query_var" : true, "supports" : [ "title","editor","page-attributes","custom-fields" ], "labels" : { "name" : "[template.get plural_label /]", "singular_name" : "[template.get singular_label /]", "menu_name" : "[template.get plural_label /]", "add_new" : "Add [template.get singular_label /]", "add_new_item" : "Add New [template.get singular_label /]", "edit" : "Edit", "edit_item" : "Edit [template.get singular_label /]", "new_item" : "New [template.get singular_label /]", "view" : "View [template.get singular_label /]", "view_item" : "View [template.get singular_label /]", "search_items" : "Search [template.get plural_label /]", "not_found" : "No [template.get plural_label /] Found", "not_found_in_trash" : "No [template.get plural_label /] Found in Trash", "parent" : "Parent [template.get singular_label /]" } } [/register.post] |