thewebscaper

cpt videos

Oct 30th, 2014
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.15 KB | None | 0 0
  1. // Custom post type.
  2. add_action('init', 'videos_register');
  3. function videos_register() {
  4.  
  5.     $labels = array(
  6.         'name' => _x('Videos', 'post type general name'),
  7.         'singular_name' => _x('Video', 'post type singular name'),
  8.         'add_new' => _x('Add New', 'video'),
  9.         'add_new_item' => __('Add New Video'),
  10.         'edit_item' => __('Edit Video'),
  11.         'new_item' => __('New Video'),
  12.         'all_items' => __( 'All Videos' ),
  13.         'view_item' => __('View Videos'),
  14.         'search_items' => __('Search Video'),
  15.         'not_found' =>  __('Nothing found'),
  16.         'not_found_in_trash' => __('Nothing found in Trash'),
  17.         'parent_item_colon' => ''
  18.     );
  19.  
  20.     $args = array(
  21.         'labels' => $labels,
  22.         'public' => true,
  23.         'publicly_queryable' => true,
  24.         'show_ui' => true,
  25.         'show_in_menu' => true,
  26.         'query_var' => true,
  27.         'menu_icon' => get_stylesheet_directory_uri() . '/images/button-video.gif',
  28.         'rewrite' => true,
  29.         'capability_type' => 'post',
  30.         'hierarchical' => false,
  31.         'menu_position' => null,
  32.         'supports' => array('title','editor','thumbnail','revisions'),
  33.         'taxonomies' => array('category')
  34.       );
  35.  
  36.     register_post_type( 'videos' , $args );
  37. }
  38. // End Custom post type.
Advertisement
Add Comment
Please, Sign In to add comment