Advertisement
Beee

register cpt results

Jan 28th, 2015
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.30 KB | None | 0 0
  1. // register post_type results
  2. function custom_post_type_init() {
  3.         $labels = array(
  4.       'name'                                => __( 'Results' ),
  5.             'singular_name'             => __( 'Results' ),
  6.             'add_new'                           => __( 'Add new result' ),
  7.             'add_new_item'              => __( 'Add new result' ),
  8.             'edit_item'                     => __( 'Edit result' ),
  9.             'new_item'                      => __( 'New result' ),
  10.             'all_items'                     => __( 'All results' ),
  11.             'view_item'                     => __( 'View result' ),
  12.             'search_items'              => __( 'Search results' ),
  13.             'not_found'                     => __( 'No results' ),
  14.             'not_found_in_trash'    => __( 'No results in trash' ),
  15.             'menu_name'                     => __( 'Results' )
  16.     );
  17.     $cptresult = array(
  18.       'labels'                              => $labels,
  19.             'public'                                => true,
  20.             'exclude_from_search'       => false,
  21.             'public_queryable'          => true,
  22.             'show_ui'                           => true,
  23.             'show_in_menu'                  => true,
  24.             'query_var'                         => 'results',
  25.             'rewrite'                               => array( 'slug' => 'results', 'feeds' => true ),
  26.             'has_archive'                       => true,
  27.             'menu_position'                 => 30,
  28.             'menu_icon'                         => get_stylesheet_directory_uri() . '/assets/images/icon-trophy.png',
  29.             'supports'                          => array('title', 'editor', 'author', 'thumbnail', 'custom-fields')
  30.     );
  31.     register_post_type( 'results', $cptresult );
  32. }
  33. add_action( 'init', 'custom_post_type_init' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement