kalponikoronno

register post type 1

Mar 6th, 2018
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.75 KB | None | 0 0
  1. function wow_theme_testimonial_post(){
  2.     register_post_type('testimonial',
  3.         array(
  4.             'labels' => array(
  5.                 'add_new'               =>  esc_html_x('Add New', 'testimonial', 'wow-shop'),
  6.                 'add_new_item'          =>  esc_html__('Add New Testimonial', 'wow-shop'),
  7.                 'all_items'             =>  esc_html__('Testimonials', 'wow-shop'),
  8.                 'edit_item'             =>  esc_html__('Edit Testimonial', 'wow-shop'),
  9.                 'menu_name'             => 'Testimonials',
  10.                 'name'                  =>  esc_html_x('Testimonials', 'post type general name', 'wow-shop'),
  11.                 'new_item'              =>  esc_html__('New Testimonial', 'wow-shop'),
  12.                 'not_found'             =>  esc_html__('No testimonial found', 'wow-shop'),
  13.                 'not_found_in_trash'    =>  esc_html__('No testimonial found in Trash', 'wow-shop'),
  14.                 'parent_item_colon'     => '',
  15.                 'search_items'          =>  esc_html__('Search', 'wow-shop'),
  16.                 'singular_name'         =>  esc_html_x('Testimonial', 'post type singular name', 'wow-shop'),
  17.                 'view_item'             =>  esc_html__('View Testimonial', 'wow-shop'),
  18.             ),
  19.             'exclude_from_search' => false,
  20.             'public'              => false,
  21.             'publicly_queryable'  => true,
  22.             'show_ui'             => true,
  23.             'menu_icon'           => 'dashicons-editor-quote',
  24.             'rewrite'             => array('slug' => 'testimonial'),
  25.             'supports'            => array(
  26.                 'title',
  27.                 'editor',
  28.                 'revisions',
  29.                 'thumbnail',
  30.                 'page-attributes',
  31.             ),
  32.         )
  33.     );            
  34.  
  35. }
  36.  
  37.  
  38. add_action('init', 'wow_theme_testimonial_post');
Advertisement
Add Comment
Please, Sign In to add comment