The Dynamic Post Types module allows you to register and manage custom post types from your WordPress admin, in Tools > Post Types menu.
All native post types settings can be set within the UI. ACF Extended also adds more advanced settings allowing to manage posts per page, order etc…
Post type key. Must not exceed 20 characters and may only contain lowercase alphanumeric characters, dashes, and underscores. See sanitize_key().
A short descriptive summary of what the post type is.
Whether the post type is hierarchical (e.g. page). Allows Parent to be specified. The supports
parameter should contain 'page-attributes' to show the parent select box on the editor page. Default false.
Core feature(s) the post type supports. Serves as an alias for calling add_post_type_support() directly. Default is an array containing 'title' and 'editor'.
An array of taxonomy identifiers that will be registered for the post type. Taxonomies can be registered later with register_taxonomy() or register_taxonomy_for_object_type().
Controls how the type is visible to authors (show_in_nav_menus
, show_ui
) and readers (exclude_from_search
, publicly_queryable
). Default: false.
Whether to exclude posts with this post type from front end search results. Default: value of the opposite of public
argument
Whether queries can be performed on the front end as part of parse_request()
. Default: value of public
argument.
Can this post_type be exported. Default: true.
Whether to delete posts of this type when deleting a user.
If true, posts of this type belonging to the user will be moved to trash when then user is deleted.
If false, posts of this type belonging to the user will not be trashed or deleted.
If not set (the default), posts are trashed if post_type_supports('author')
. Otherwise posts are not trashed or deleted. Default: null.
Whether to generate a default UI for managing this post type in the admin. Default: value of public
argument
Which template file to load for the archive query. Default: Template hierarchy
Enables post type archives. Default: false
Will use name
as archive slug by default.
Number of posts to display in the archive page. Default: 10
Sort retrieved posts by parameter in the archive page. Default: date (post_date
).
Designates the ascending or descending order of the orderby
parameter in the archive page. Default: DESC.
Which template file to load for the single query. Default: Template hierarchy
Triggers the handling of rewrites for this post type. To prevent rewrites, set to false. Default: true and use name
as slug
Use additional rewrite arguments
Customize the permalink structure slug. Defaults to the name
value. Should be translatable.
Should the permalink structure be prepended with the front base. (example: if your permalink structure is /blog/
, then your links will be: false->/news/
, true->/blog/news/
). Defaults to true.
Should a feed permalink structure be built for this post type. Defaults to has_archive
value.
Should the permalink structure provide for pagination. Defaults to true.
Add an "Archive" Options Page as submenu of the post type.
Number of posts to display on the admin list screen. Default: 10
Sort retrieved posts by parameter in the admin list screen. Default: date (post_date
).
Designates the ascending or descending order of the orderby
parameter in the admin list screen. Default: DESC.
An array of labels for this post type. By default, post labels are used for non-hierarchical post types and page labels for hierarchical ones.
Default: if empty, name
is set to value of label
, and singular_name
is set to value of name
.
The string to use to build the read, edit, and delete capabilities.
May be passed as an array to allow for alternative plurals when using this argument as a base to construct the capabilities, like this:
story
stories
An array of the capabilities for this post type. Specify capabilities like this:
edit_post : edit_book
read_post : read_book
delete_post : delete_book
edit_posts : edit_books
publish_posts : publish_books
etc...
Whether to expose this post type in the REST API. Must be true to enable the Gutenberg editor. Default: false.
The base slug that this post type will use when accessed using the REST API: Default: name
.
An optional custom controller to use instead of WP_REST_Posts_Controller. Must be a subclass of WP_REST_Controller. Default: WP_REST_Posts_Controller.
The pro version allows developers to manually activate Post Typesindividually using the “Active” switch in the sidebar.
The module is shipped with a fully functional Json/PHP Sync feature, cousin of the native ACF Field Group Json/PHP Sync.
Set settings in PHP on existing post types or Export/Import using Json files.
ACF Extended use the native ACF setting show_admin
to determine if the module menu should be displayed or not. You can read more about that setting on the ACF article How to hide ACF menu from clients. Usage example:
add_filter('acf/settings/show_admin', '__return_false');
The Post Types module is enabled by default. It can be enabled and disabled in the Settings UIPRO, or with the following code:
add_action('acf/init', 'my_acfe_modules');
function my_acfe_modules(){
// disable post types
acf_update_setting('acfe/modules/post_types', false);
}
add_action('acfe/init', 'my_acfe_modules');
function my_acfe_modules(){
// disable post types
acfe_update_setting('modules/post_types', false);
}