The main goal of Cuztom is to register Custom Post Types. This can easily be done.
$book = register_cuztom_post_type( $name, $args );
(string|array) The name/title of the Post Type. When using an array, the first element is the name, the second element is the plural name.
(array) Arguments used for the Post Type. Take a look here to see which arguments are available
Normally has_archive defaults to false, with Cuztom it defaults to true.
You can add/remove post type support by using a method, handy when you want to add/remove it conditionally. Here is a list of all features.
// Add support $book->addPostTypeSupport( $feature ); // Remove support $book->removePostTypeSupport( $feature ); // Check for support $book->postTypeSupports( $feature );
You can use an object method to easily attach a Meta Box to the new Post Type. See Post (Meta Box) for the complete documentation.
$book->addMetaBox( $id, $data );
Like Meta Boxes, you can also attach (existing) Taxonomies to the Post Type object. See Taxonomy for the complete documentation.
$book->addTaxonomy( $name, $args );
You can pass various arguments to Post Type object. Here is the full list.
$book = register_cuztom_post_type( 'Book', array( 'has_archive' => true, 'supports' => array( 'title', 'editor', 'thumbnail' ), 'exclude_from_search' => true ) );
Updated almost 6 years ago