Advertisement
Guest User

CPT

a guest
Jul 28th, 2011
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.57 KB | None | 0 0
  1. // registration code for players post type
  2.                 function register_players_posttype() {
  3.                     $labels = array(
  4.                         'name'              => _x( 'players', 'post type general name' ),
  5.                         'singular_name'     => _x( 'player', 'post type singular name' ),
  6.                         'add_new'           => _x( 'Add New', 'player'),
  7.                         'add_new_item'      => __( 'Add New player '),
  8.                         'edit_item'         => __( 'Edit player '),
  9.                         'new_item'          => __( 'New player '),
  10.                         'view_item'         => __( 'View player '),
  11.                         'search_items'      => __( 'Search players '),
  12.                         'not_found'         =>  __( 'No player found' ),
  13.                         'not_found_in_trash'=> __( 'No players found in Trash' ),
  14.                         'parent_item_colon' => ''
  15.                     );
  16.                    
  17.                     $supports = array('title','editor','author','thumbnail','excerpt','custom-fields','comments','revisions','title','editor','author','thumbnail','excerpt','custom-fields','comments','revisions','title','editor','author','thumbnail','excerpt','custom-fields','comments','post-formats','page-attributes');
  18.                    
  19.                     $post_type_args = array(
  20.                         'labels'            => $labels,
  21.                         'singular_label'    => __('player'),
  22.                         'public'            => true,
  23.                         'show_ui'           => true,
  24.                         'publicly_queryable'=> true,
  25.                         'query_var'         => true,
  26.                         'capability_type'   => 'post',
  27.                         'has_archive'       => true,
  28.                         'hierarchical'      => true,
  29.                         'rewrite'           => array('slug' => 'players'),
  30.                         'supports'          => $supports,
  31.                         'menu_position'     => 5,
  32.                         'menu_icon'         => ''
  33.                      );
  34.                      register_post_type('players',$post_type_args);
  35.                 }
  36.                 add_action('init', 'register_players_posttype');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement