Created
September 6, 2015 23:44
-
-
Save vladimirlukyanov/0d14adc83f30a90cd1fd to your computer and use it in GitHub Desktop.
Register custom post type WordPress
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
<?php | |
// Register casino | |
$labels = array( | |
'name' => __('Casino', 'tps'), | |
'singular_name' => __('Casino', 'tps'), | |
'add_new' => __('Add casino', 'tps'), | |
'add_new_item' => __('Add new casino', 'tps'), | |
'edit_item' => __('Edit casino', 'tps'), | |
'new_item' => __('New casino', 'tps'), | |
'all_items' => __('All casinos', 'tps'), | |
'view_item' => __('View casino', 'tps'), | |
'search_items' => __('Search', 'tps'), | |
'not_found' => __('No casino found', 'tps'), | |
'not_found_in_trash' => __('No casino found in trash', 'tps'), | |
'parent_item_colon' => '', | |
'menu_name' => __('Casino', 'tps'), | |
); | |
$args = array( | |
'labels' => $labels, | |
'public' => true, | |
'publicly_queryable' => true, | |
'exclude_from_search' => true, | |
'show_ui' => true, | |
'show_in_menu' => true, | |
'show_in_nav_meanus' => true, | |
'query_var' => true, | |
'capability_type' => 'post', | |
'has_archive' => true, | |
'hierarchical' => false, | |
'menu_position' => 6, | |
'supports' => array('title', 'editor', 'thumbnail'), | |
'rewrite' => array('slug' => 'casino'), | |
'with_front' => false | |
); | |
register_post_type('casino', $args); | |
register_taxonomy('software', 'casino', | |
array('hierarchical' => false, | |
'label' => 'Software', | |
'query_var' => true, | |
'rewrite' => true)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment