Advertisement
Guest User

Untitled

a guest
Sep 9th, 2013
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.59 KB | None | 0 0
  1. <?php
  2. function create_portfolio_post_type() {
  3.     register_post_type( 'portfolio',
  4.         array(
  5.             'labels' => array(
  6.                 'name' => _x( 'Portfolio', 'Portfolio post type general name', 'textdomain' ),
  7.                 'singular_name' => _x( 'Portfolio Item', 'Portfolio post type singular name', 'textdomain' ),
  8.                 'add_new' => _x( 'Add New', 'Portfolio post type', 'textdomain' ),
  9.                 'add_new_item' => __( 'Add New Portfolio Item', 'textdomain' ),
  10.                 'edit_item' => __( 'Edit Portfolio Item', 'textdomain' ),
  11.                 'new_item' => __( 'New Portfolio Item', 'textdomain' ),
  12.                 'view_item' => __( 'View Portfolio Item', 'textdomain' ),
  13.                 'search_items' => __( 'Search Portfolio Items', 'textdomain' ),
  14.                 'not_found' =>  __( 'No portfolio items found', 'textdomain' ),
  15.                 'not_found_in_trash' => __( 'No portfolio items found in Trash', 'textdomain' ),
  16.                 'parent_item_colon' => '',
  17.                 'menu_name' => _x( 'Portfolio', 'Portfolio menu name', 'textdomain' ),
  18.             ),
  19.             'public' => true,
  20.             'exclude_from_search' => true,
  21.             'has_archive' => true,
  22.             'supports' => array( 'title', 'editor', 'author', 'trackbacks', 'custom-fields', 'comments', 'revisions', 'page-attributes' ),
  23.             'rewrite' => array( 'slug' => 'portfolio-items' )
  24.         )
  25.     );
  26.     register_taxonomy( 'portfolio_category', 'portfolio',
  27.         array(
  28.             'hierarchical' => true,
  29.             'labels' => array(
  30.                 'name' => _x( 'Portfolio Categories', 'Portfolio taxonomy general name', 'textdomain' ),
  31.                 'singular_name' => _x( 'Portfolio Category', 'Portfolio taxonomy singular name', 'textdomain' ),
  32.                 'search_items' =>  __( 'Search Categories', 'textdomain' ),
  33.                 'popular_items' => __( 'Popular Categories', 'textdomain' ),
  34.                 'all_items' => __( 'All Categories', 'textdomain' ),
  35.                 'parent_item' => null,
  36.                 'parent_item_colon' => null,
  37.                 'edit_item' => __( 'Edit Portfolio Category', 'textdomain' ),
  38.                 'update_item' => __( 'Update Portfolio Category', 'textdomain' ),
  39.                 'add_new_item' => __( 'Add New Portfolio Category', 'textdomain' ),
  40.                 'new_item_name' => __( 'New Portfolio Category Name', 'textdomain' ),
  41.                 'separate_items_with_commas' => __( 'Separate Portfolio category with commas', 'textdomain' ),
  42.                 'add_or_remove_items' => __( 'Add or remove portfolio category', 'textdomain' ),
  43.                 'choose_from_most_used' => __( 'Choose from the most used portfolio category', 'textdomain' ),
  44.                 'not_found' => __( 'No categories found.', 'textdomain' ),
  45.                 'menu_name' => __( 'Portfolio Categories', 'textdomain' ),
  46.             ),
  47.             'show_ui' => true,
  48.             'query_var' => true,
  49.             'rewrite' => true,
  50.         )
  51.     );
  52. }
  53. add_action( 'init', 'create_portfolio_post_type' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement