Advertisement
darrenbachan

Untitled

Jun 11th, 2016
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.64 KB | None | 0 0
  1. function dbwp_register_post_type() {
  2.  
  3.         $singular = 'Upcoming Game';
  4.         $plural = 'Upcoming Games';
  5.  
  6.         $labels = array(
  7.                 'name'                  => $plural,
  8.                 'singular'              => $singular,
  9.                 'add_name'              => 'Add New',
  10.                 'add_new_item'          => 'Add New  ' . $singular,
  11.                 'edit'                  => 'Edit',
  12.                 'edit_item'             => 'Edit ' . $singular,
  13.                 'new_item'              => 'New ' . $singular,
  14.                 'view'                  => 'View ' . $singular,
  15.                 'view_item'             => 'View ' . $singular,
  16.                 'search_term'           => 'Search ' . $plural,
  17.                 'parent'                => 'Parent ' . $singular,
  18.                 'not_found'             => 'No ' . $plural . ' found',
  19.                 'not_found_in_trash'    => 'No ' . $plural . ' in Trash'
  20.         );
  21.  
  22.         $args = array(
  23.                 'labels'                => $labels,
  24.                 'public'                => true,
  25.                 'publicly_queryable'    => true, //true
  26.                 'exclude_from_search'   => true, //false
  27.                 'show_in_nav_menus'     => true,
  28.                 'show_ui'               => true,
  29.                 'show_in_menu'          => true,
  30.                 'show_in_admin_bar'     => true,
  31.                 'menu_position'         => 6,
  32.                 'menu_icon'             => 'dashicons-megaphone',
  33.                 'can_export'            => true,
  34.                 'delete_with_user'      => false,
  35.                 'hierarchical'          => false,
  36.                 'has_archive'           => true,
  37.                 'query_var'             => true,
  38.                 'capability_type'       => 'post',
  39.                 'map_meta_cap'          => true,
  40.                 // 'capabilities' => array(),
  41.                 'rewrite'               => array(
  42.                         'slug'                  => $slug,
  43.                         'with_front'            => false,
  44.                         'pages'                 => true,
  45.                         'feeds'                 => false,
  46.                         ),
  47.                 'supports'              => array(
  48.                         'title',
  49.                         'editor',
  50.                         'author',
  51.                         'thumbnail',
  52.                         'custom-fields',
  53.                         'comments',
  54.                         'revisions'
  55.                 )
  56.         );
  57.  
  58.         register_post_type('upcoming-games', $args);
  59.  
  60. }
  61. add_action('init', 'dbwp_register_post_type');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement