Ever since I started using Genesis, I have spent a lot of time studying the source code. The other day I noticed a new class that was included in 2.0 beta; Custom Post Type Archive Settings.
So… What is it?
Custom post type archive settings is a sub menu under a custom post type menu.
Within this menu, users will be able to specify an archive headline, intro text, SEO, and layout settings for the front-end custom post type archive page.
This will display a custom title and description on your custom post type archive page. As an example, I have added a title and description to my projects archive page.
Enable archive settings support
This feature will probably work with most custom post types out-of-the-box. While registering the custom post type, add ‘genesis-cpt-archives-settings’ to the support parameter within the register_post_type() arguments. By adding this feature, Genesis will know to add the Archive Settings sub menu to your post type.
How this works with your custom post type
Before the admin menus are built, Genesis will grab post type objects that meet certain arguments. Once the post type objects have been gathered, Genesis will check if the post type object supports the ‘genesis-cpt-archives-settings’ feature. Those remaining post type objects with ‘genesis-cpt-archives-settings’ support will have the archive settings menu.
I included the Genesis source code snippet above to demonstrate how post type objects are collected before creating the sub menus. The code gathers post types with public, show_ui, show_in_menu, has_archive arguments set to true and _builtin set to false. These arguments are defined when you register your post type.
These settings basically set the post type to be viewed on the front-end with the custom post type archive page and have admin menus generated by WordPress. If the custom post type does not match these arguments, the ‘genesis_cpt_archives_args’ filter can be used to extend the functionality.
What if a plugin is registering a custom post type? Support can be added after the custom post type has been registered with add_post_type_support().
The custom post type archive class inherits from the Genesis_Admin_Boxes class. This will allow developers to add additional meta boxes to their post type archive settings menu.