Skip to content

Instantly share code, notes, and snippets.

@eliasfaical
Created September 26, 2018 23:51
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 eliasfaical/2f4088e8dff6a422e0809c3a5b183e5c to your computer and use it in GitHub Desktop.
Save eliasfaical/2f4088e8dff6a422e0809c3a5b183e5c to your computer and use it in GitHub Desktop.
<?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