Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
add_action( 'init', 'yoursite_init' );
function yoursite_init() {
register_post_type('dish',array(
'label'=> 'Dishes',
'public'=> true,
'publicly_queryable'=>true,
'show_ui'=>true,
'show_in_nav_menus'=>true,
'query_var'=>'dish',
'rewrite'=>array('slug'=>'dishes'),
'capability_type'=>'page',
'hierarchicial'=>true,
'menu_position'=>5,
'supports'=>array(
'title',
'editor',
'thumbnail',
'excerpt',
'custom-fields',
'revisions'
)
));
register_taxonomy('Main Ingredient', array('dish'), array(
'hierarchical' => true,
'label' => 'Main Ingredient',
'singular_label' => 'Main Ingredient',
'query_var'=>true,
'rewrite' => true
));
global $wp_rewrite;
$wp_rewrite->flush_rules();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.