-
-
Save eliasfaical/2f4088e8dff6a422e0809c3a5b183e5c to your computer and use it in GitHub Desktop.
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 Custom Post Types | |
function register_custom_posts_cases() { | |
// Register Products | |
$products_labels = array( | |
'name' => 'Cases', | |
'singular_name' => 'Cases', | |
'menu_name' => 'Cases' | |
); | |
$products_args = array( | |
'labels' => $products_labels, | |
'public' => true, | |
'capability_type' => 'post', | |
'has_archive' => true, | |
'menu_position' => 2, | |
'supports' => array( 'title', 'editor', 'thumbnail', 'excerpt' ), | |
'taxonomies' => array() | |
); | |
register_post_type('case', $products_args); | |
} | |
add_action('init', 'register_custom_posts_cases'); | |
function create_taxonomies_case() { | |
register_taxonomy( 'categoria-case', 'case', | |
array( | |
'labels' => array( | |
'name' => 'Categoria case', | |
'add_new_item' => 'Novo', | |
'new_item_name' => "Novo" | |
), | |
'show_ui' => true, | |
'show_tagcloud' => false, | |
'hierarchical' => true | |
) | |
); | |
} | |
add_action( 'init', 'create_taxonomies_case', 0 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment