Created
July 19, 2012 14:58
-
-
Save seanwash/3144520 to your computer and use it in GitHub Desktop.
Wordpress: Wordpress Register Custom Post Type
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'init', 'create_events' ); | |
function create_events() { | |
$labels = array( | |
'name' => _x('Events', 'post type general name'), | |
'singular_name' => _x('Event', 'post type singular name'), | |
'add_new' => _x('Add New', 'Event'), | |
'add_new_item' => __('Add New Event'), | |
'edit_item' => __('Edit Event'), | |
'new_item' => __('New Event'), | |
'view_item' => __('View Event'), | |
'search_items' => __('Search Events'), | |
'not_found' => __('No Events found'), | |
'not_found_in_trash' => __('No Events found in Trash'), | |
'parent_item_colon' => '' | |
); | |
$supports = array('title', 'editor', 'custom-fields', 'revisions', 'excerpt'); | |
register_post_type( 'event', | |
array( | |
'labels' => $labels, | |
'public' => true, | |
'supports' => $supports | |
) | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment