title: WordPress Custom Post Types with own lists
body: <p>I have in my theme a custom post type called &quot;recipes&quot;. I can add text, a thumbnail and add categories. I want to add a ingredients list to this post type. I need a global list of ingredients which I can use for a single recipe. How can i create a global list for the custom post type like categories but just for ingredients?</p>
  <p>Here's my code for the post type:</p>
  <pre><code>&lt;?php
  add_action( 'init', 'my_recipes' );
  add_filter( 'post_updated_messages', 'my_recipes_messages' );
  add_action( 'admin_head', 'my_recipes_help' );
  
  function my_recipes() {
  $labels = array(
  'name'               =&gt; 'Recipes',
  'singular_name'      =&gt; 'Recipe',
  'menu_name'          =&gt; 'Recipes',
  'name_admin_bar'     =&gt; 'Recipe',
  'add_new'            =&gt; 'Add New',
  'add_new_item'       =&gt; 'Add New Recipe',
  'new_item'           =&gt; 'New Recipe',
  'edit_item'          =&gt; 'Edit Recipe',
  'view_item'          =&gt; 'View Recipe',
  'all_items'          =&gt; 'All Recipes',
  'search_items'       =&gt; 'Search Recipes',
  'parent_item_colon'  =&gt; 'Parent Recipes:',
  'not_found'          =&gt; 'No recipes found.',
  'not_found_in_trash' =&gt; 'No recipes found in Trash.'
  );
  
  $args = array(
  'labels'        =&gt; $labels,
  'public'        =&gt; true,
  'rewrite'       =&gt; array( 'slug' =&gt; 'recipe' ),
  'has_archive'   =&gt; true,
  'menu_position' =&gt; 20,
  'menu_icon'     =&gt; 'dashicons-carrot',
  'taxonomies'        =&gt; array( 'post_tag', 'category' ),
  'supports'      =&gt; array( 'title', 'editor', 'author', 'thumbnail', 'excerpt')
  );
  register_post_type( 'my_recipe', $args );
  }
  
  function my_recipes_messages( $messages ) {
  $post = get_post();
  
  $messages['recipe'] = array(
  0  =&gt; '',
  1  =&gt; 'Recipe updated.',
  2  =&gt; 'Custom field updated.',
  3  =&gt; 'Custom field deleted.',
  4  =&gt; 'Recipe updated.',
  5  =&gt; isset( $_GET['revision'] ) ? sprintf( 'Recipe restored to revision from %s',wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
  6  =&gt; 'Recipe published.',
  7  =&gt; 'Recipe saved.',
  8  =&gt; 'Recipe submitted.',
  9  =&gt; sprintf(
  'Recipe scheduled for: &lt;strong&gt;%1$s&lt;/strong&gt;.',
  date_i18n( 'M j, Y @ G:i', strtotime( $post-&gt;post_date ) )
  ),
  10 =&gt; 'Recipe draft updated.'
  );
  
  return $messages;
  }
  
  function my_recipes_help() {
  
  $screen = get_current_screen();
  
  if ( 'recipe' != $screen-&gt;post_type ) {
  return;
  }
  
  $basics = array(
  'id'      =&gt; 'recipe_basics',
  'title'   =&gt; 'Recipe Basics',
  'content' =&gt; 'Content for help tab here'
  );
  
  $formatting = array(
  'id'      =&gt; 'recipe_formatting',
  'title'   =&gt; 'Recipe Formatting',
  'content' =&gt; 'Content for help tab here'
  );
  
  $screen-&gt;add_help_tab( $basics );
  $screen-&gt;add_help_tab( $formatting );
  
  }
  </code></pre>