Advertisement
leadbellydesign

custom-post-types

May 10th, 2012
317
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.85 KB | None | 0 0
  1. add_action( 'init', 'create_spotlight' );
  2. function create_spotlight() {
  3.   $labels = array(
  4.     'name' => _x('Spotlight Items', 'post type general name'),
  5.     'singular_name' => _x('Spotlight', 'post type singular name'),
  6.     'add_new' => _x('Add New', 'Spotlight Item'),
  7.     'add_new_item' => __('Add New Spotlight Item'),
  8.     'edit_item' => __('Edit Spotlight Item'),
  9.     'new_item' => __('New Spotlight Item'),
  10.     'view_item' => __('View Spotlight Item'),
  11.     'search_items' => __('Search Spotlight Items'),
  12.     'not_found' =>  __('No Spotlight Items found'),
  13.     'not_found_in_trash' => __('No Spotlight Items found in Trash'),
  14.     'parent_item_colon' => ''
  15.   );
  16.  
  17.   $supports = array('title','editor','custom-fields','author','thumbnail');
  18.  
  19.   register_post_type( 'spotlight',
  20.     array(
  21.       'labels' => $labels,
  22.       'public' => true,
  23.       'menu_position' => 20,
  24.       'supports' => $supports
  25.     )
  26.   );
  27. }
  28.  
  29. /* CUSTOM POST TYPE : COOKING VIDEOS */
  30.  
  31. // Register event post type //
  32.  
  33. add_action( 'init', 'create_cookingvideo' );
  34. function create_cookingvideo() {
  35.   $labels = array(
  36.     'name' => _x('Cooking Videos', 'post type general name'),
  37.     'singular_name' => _x('Cooking Video', 'post type singular name'),
  38.     'add_new' => _x('Add New', 'Cooking Video'),
  39.     'add_new_item' => __('Add New Cooking Video'),
  40.     'edit_item' => __('Edit Cooking Video'),
  41.     'new_item' => __('New Cooking Video'),
  42.     'view_item' => __('View Cooking Video'),
  43.     'search_items' => __('Search Cooking Video'),
  44.     'not_found' =>  __('No Cooking Videos found'),
  45.     'not_found_in_trash' => __('No Cooking Videos found in Trash'),
  46.     'parent_item_colon' => ''
  47.   );
  48.  
  49.   $supports = array('title','editor','custom-fields','author','thumbnail');
  50.  
  51.   register_post_type( 'cookingvideo',
  52.     array(
  53.       'labels' => $labels,
  54.       'public' => true,
  55.       'menu_position' => 20,
  56.       'supports' => $supports
  57.     )
  58.   );
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement