Advertisement
martcol

CPT_Testimonial

Feb 10th, 2014
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.24 KB | None | 0 0
  1. <?php
  2. /**
  3. * Plugin Name: Testimonial
  4. * Version: 1.0.01
  5. * Author: martcol
  6. * Author URI: http://martcol.co.uk/
  7. */
  8. if ( ! function_exists('custom_post_type') ) {
  9. // Register Custom Post Type
  10. function custom_post_type() {
  11.  
  12.     $labels = array(
  13.         'name'                => _x( 'Testimonials', 'Post Type General Name', 'text_domain' ),
  14.         'singular_name'       => _x( 'Testimonial', 'Post Type Singular Name', 'text_domain' ),
  15.         'menu_name'           => __( 'Testimonials', 'text_domain' ),
  16.         'parent_item_colon'   => __( 'Parent Testimonial:', 'text_domain' ),
  17.         'all_items'           => __( 'All Testimonials', 'text_domain' ),
  18.         'view_item'           => __( 'View Testimonials', 'text_domain' ),
  19.         'add_new_item'        => __( 'Add New Testimonial', 'text_domain' ),
  20.         'add_new'             => __( 'Add New', 'text_domain' ),
  21.         'edit_item'           => __( 'Edit Testimonial', 'text_domain' ),
  22.         'update_item'         => __( 'Update Testimonial', 'text_domain' ),
  23.         'search_items'        => __( 'Search Item', 'text_domain' ),
  24.         'not_found'           => __( 'Not found', 'text_domain' ),
  25.         'not_found_in_trash'  => __( 'Not found in Trash', 'text_domain' ),
  26.     );
  27.     $rewrite = array(
  28.         'slug'                => 'testimonial',
  29.         'with_front'          => true,
  30.         'pages'               => true,
  31.         'feeds'               => true,
  32.     );
  33.     $args = array(
  34.         'label'               => __( 'post_type', 'text_domain' ),
  35.         'description'         => __( 'What people say about Abba Mini Skip Hire', 'text_domain' ),
  36.         'labels'              => $labels,
  37.         'supports'            => array( 'title', 'editor' ),
  38.         'taxonomies'          => array( 'category', 'post_tag' ),
  39.         'hierarchical'        => false,
  40.         'public'              => true,
  41.         'show_ui'             => true,
  42.         'show_in_menu'        => true,
  43.         'show_in_nav_menus'   => true,
  44.         'show_in_admin_bar'   => true,
  45.         'menu_position'       => 5,
  46.         'menu_icon'           => '#',
  47.         'can_export'          => true,
  48.         'has_archive'         => true,
  49.         'exclude_from_search' => false,
  50.         'publicly_queryable'  => true,
  51.         'rewrite'             => $rewrite,
  52.         'capability_type'     => 'post',
  53.     );
  54.     register_post_type( 'post_type', $args );
  55.  
  56. }
  57.  
  58. // Hook into the 'init' action
  59. add_action( 'init', 'custom_post_type', 0 );
  60.  
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement