Advertisement
Guest User

Untitled

a guest
Apr 6th, 2011
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.48 KB | None | 0 0
  1. add_action('init', 'campaign_register');
  2.  
  3. function campaign_register() {
  4.  
  5.     $labels = array(
  6.         'name' => _x('My Campaigns', 'post type general name'),
  7.         'singular_name' => _x('Campaign Item', 'post type singular name'),
  8.         'add_new' => _x('Add New', 'campaign item'),
  9.         'add_new_item' => __('Add New Campaign Item'),
  10.         'edit_item' => __('Edit Campaign Item'),
  11.         'new_item' => __('New Campaign Item'),
  12.         'view_item' => __('View Campaign Item'),
  13.         'search_items' => __('Search Campaigns'),
  14.         'not_found' =>  __('Nothing found'),
  15.         'not_found_in_trash' => __('Nothing found in Trash'),
  16.         'parent_item_colon' => ''
  17.     );
  18.  
  19.     $args = array(
  20.         'labels' => $labels,
  21.         'public' => true,
  22.         'publicly_queryable' => true,
  23.         'show_ui' => true,
  24.         'query_var' => true,
  25.         'menu_icon' => get_stylesheet_directory_uri() . '/images/icon.gif',
  26.         'rewrite' => true,
  27.         'capability_type' => 'page',
  28.         'hierarchical' => false,
  29.         'menu_position' => null,
  30.         'supports' => array('title','editor','thumbnail')
  31.       );
  32.  
  33.     register_post_type( 'campaign' , $args );
  34. }
  35.  
  36. add_action( 'init', 'create_product_taxonomies', 0 );
  37.  
  38. function create_product_taxonomies() {
  39.        
  40.   register_taxonomy('Product_Categories',array('campaign'), array(
  41.     'hierarchical' => true,
  42.     'public' => true,
  43.     'label' => 'Product Categories',
  44.     'singular_label' => 'Product Category',
  45.     'show_ui' => true,
  46.     'query_var' => true,
  47.     'capabilities' => array ('manage_terms'),
  48.     'rewrite' => array( 'slug' => 'product' ),
  49.   ));
  50.  
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement