destos / wp-post_type-class

Class for quickly setting up custom post types within wordpress - hopefully more to come!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This class allows you to easily add new post types and taxonomies to WordPress in a oop manner.
plus it does some of the heavy lifting in regards to automagically creating labels and messages, along with pluralization.

Example usage.

NewPostType::instance()->add(array(
	'post_type' => 'featured',
	'args' => array(
		'rewrite' => array( 'slug' => 'featured' ),
		'supports' => array( 'title', 'editor', 'excerpt' ),
		'menu_icon' => get_bloginfo('template_directory').'/functions/classes/posttype/icons/star.png'
	),
	'thumbs' => array(
		'front-large' => array( 700, 260, true )
	)
))->add_taxonomy( 'laland', array(
	'taxonomy_single' => 'Lalalalander'
));

About

Class for quickly setting up custom post types within wordpress - hopefully more to come!


Languages

Language:PHP 100.0%