Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zanematthew/1268620 to your computer and use it in GitHub Desktop.
Save zanematthew/1268620 to your computer and use it in GitHub Desktop.
Sample: registerPostType
public function registerPostType( $args=NULL ) {
foreach ( $this->post_type as $post_type ) {
if ( !empty( $post_type['taxonomies'] ) )
$taxonomies = $post_type['taxonomies'];
.
.
.
.
$labels = array(
'name' => _x( $post_type['name'], 'post type general name'),
'singular_name' => _x( $post_type['singular_name'], 'post type singular name'),
'add_new' => _x('Add New ' . $post_type['singular_name'] . '', 'something'),
'add_new_item' => __('Add New ' . $post_type['singular_name'] . ''),
'edit_item' => __('Edit '. $post_type['singular_name'] .''),
'new_item' => __('New '. $post_type['singular_name'] .''),
'view_item' => __('View '. $post_type['singular_name'] . ''),
'search_items' => __('Search ' . $post_type['singular_name'] . ''),
'not_found' => __('No ' . $post_type['singular_name'] . ' found'),
'not_found_in_trash' => __('No ' . $post_type['singular_name'] . ' found in Trash'),
'parent_item_colon' => ''
);
.
.
.
register_post_type( $post_type['type'], $args);
} // End 'foreach'
return $this->post_type;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment