BREAKING! v7 - exclude_from_search no longer set to false by default - sleek/post_types/archive_fields filter now gets passed the post type object - not just its name - as its second argument
Create post types by creating classes in /post-types/
.
N/A
Filter the ACF field group for post types before they're added.
Filter the ACF fields for post types before they're added.
Filter the ACF fields for the archive settings before they're added.
Return information about all files in /post-types/
(internal use).
Extend this class to create a post type.
This method is called once on every page load. It allows you to add hooks or do whatever you like related to your post type.
Return an array of post type configuration here. The array is passed directly to register_post_type. A few additional properties are available:
This is a native WordPress property but unlike when calling register_post_type()
any taxonomy set in here will be automatically created if it doesn't already exist.
Set this to false to disable single pages for the post type.
Hides the post type from search without the side effects of the built-in exclude_from_search
.
Set this to false to not add a "Settings" page for the post type.
If this is false the settings page will be empty, if not it will have a "Title", "Image" and "Description".
Return an array of ACF fields from here and they will be added to the post type.
Return an array of module names and they will be added to the post type. Render a sticky module using Sleek\Modules\render('name-of-module')
.
Return an array of module names and they will be available in a flexible content field named flexible_modules
. An associative array can be used to create multiple flexible content fields;
[
'left_column' => ['text-block', 'text-blocks'],
'right_column' => ['related-posts', 'recent-comments']
]
Render a flexible module field using Sleek\Modules\render_flexible('flexible_modules')
or Sleek\Modules\render_flexible('left_column')
etc.
Return an array of module names and they will be added to the post type's settings page. Render a sticky module using Sleek\Modules\render('name-of-module', 'mycpt_settings')
.
Return an array of module names and they will be available in a flexible content field named flexible_modules
on the post type's settings page. An associative array can be used here too.
Render modules on the settings page using Sleek\Modules\render_flexible('flexible_modules', 'mycpt_settings')
.