Created
November 22, 2017 01:42
-
-
Save thegrid22593/f4a516a210f8dbeeb011be49e7d5ee0c to your computer and use it in GitHub Desktop.
WordPress Custom Post Type Register Function
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_units_post_type'); | |
function create_units_post_type() { | |
$labels = array( | |
'name' => __('Site Plan'), | |
'singular_name' => __('Unit'), | |
'all_items' => __('All Units'), | |
'add_new' => _x('Add new Unit', 'Unit'), | |
'add_new_item' => __('Add new Unit'), | |
'edit_item' => __('Edit Unit'), | |
'new_item' => __('New Unit'), | |
'view_item' => __('View Unit'), | |
'search_items' => __('Search in Unit'), | |
'not_found' => __('No Unit found'), | |
'not_found_in_trash' => __('No Units found in trash'), | |
'parent_item_colon' => '' | |
); | |
$args = array ( | |
'labels' => $labels, | |
'public' => true, | |
'has_archive' => true, | |
'menu_icon' => 'dashicons-admin-multisite', | |
'rewrite' => array('slug' => 'units'), | |
'taxonomies' => array( /*'category',*/ 'unit'), | |
'query_var' => true, | |
'menu_position' => 22, | |
'supports'=> array('thumbnail' , /*'custom-fields',*/ 'title', 'editor', 'excerpt') | |
); | |
register_post_type('units', $args); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment