Advertisement
sqrbrkt

CPT

Jun 9th, 2011
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.45 KB | None | 0 0
  1. <?php
  2.  
  3. /* Add Custom Post Type */
  4. add_action( 'init', 'create_vicinity_cpt' );
  5.  
  6. function create_vicinity_cpt() {
  7.     register_post_type( 'attractions',
  8.         array(
  9.             'labels' => array(
  10.                 'name' => __( 'Attractions' ),
  11.                 'singular_name' => __( 'Attraction' ),
  12.                 'add_new' => __( 'Add New Attractions' ),
  13.                 'add_new_item' => __( 'Add New Attraction' ),
  14.                 'edit' => __( 'Edit Attractions' ),
  15.                 'edit_item' => __( 'Edit Attraction' ),
  16.                 'new_item' => __( 'Add New Attraction' ),
  17.                 'view' => __( 'View Attractions' ),
  18.                 'view_item' => __( 'View Attraction' ),
  19.                 'search_items' => __( 'Search Vicinity' ),
  20.                 'not_found' => __( 'No Attractions Found' ),
  21.                 'not_found_in_trash' => __( 'No Attractions found in Trash' ),
  22.                 'menu_name' => 'Vicinity'
  23.             ),
  24.             'description' => __('Attractions to be shown in Vicinity section.'),
  25.             'public' => true,
  26.             'show_ui' => true,
  27.             'publicly_queryable' => true,
  28.             'exclude_from_search' => false,
  29.             'show_in_menu' => true,
  30.             'menu_position' => 21,
  31.             'supports' => array( 'title', 'editor', 'thumbnail' ),
  32.             'can_export' => true,
  33.             'hierarchichal' => false,
  34.             'capability_type' => 'post'
  35.         )
  36.     );
  37. }
  38.  
  39. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement