Skip to content

Instantly share code, notes, and snippets.

@mikeschinkel
Created January 30, 2011 05:30
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 mikeschinkel/e4cafd98069a5304111e to your computer and use it in GitHub Desktop.
Save mikeschinkel/e4cafd98069a5304111e to your computer and use it in GitHub Desktop.
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