Last active
August 29, 2015 14:08
-
-
Save theukedge/0adf13a39858afb88215 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // REGISTER TESTIMONIAL CPT | |
if ( ! function_exists('twpb_testimonial_cpt') ) { | |
function twpb_testimonial_cpt() { | |
$labels = array( | |
'name' => _x( 'Testimonials', 'Post Type General Name', 'twpb' ), | |
'singular_name' => _x( 'Testimonial', 'Post Type Singular Name', 'twpb' ), | |
'menu_name' => __( 'Testimonial', 'twpb' ), | |
'parent_item_colon' => __( 'Parent Testimonial:', 'twpb' ), | |
'all_items' => __( 'All Testimonials', 'twpb' ), | |
'view_item' => __( 'View Testimonial', 'twpb' ), | |
'add_new_item' => __( 'Add New Testimonial', 'twpb' ), | |
'add_new' => __( 'New Testimonial', 'twpb' ), | |
'edit_item' => __( 'Edit Testimonial', 'twpb' ), | |
'update_item' => __( 'Update Testimonial', 'twpb' ), | |
'search_items' => __( 'Search testimonials', 'twpb' ), | |
'not_found' => __( 'No testimonials found', 'twpb' ), | |
'not_found_in_trash' => __( 'No testimonials found in trash', 'twpb' ), | |
); | |
$args = array( | |
'label' => __( 'testimonial', 'twpb' ), | |
'description' => __( 'Client testimonials', 'twpb' ), | |
'labels' => $labels, | |
'supports' => array( 'title', 'editor', 'excerpt', ), | |
'taxonomies' => array( '' ), | |
'hierarchical' => false, | |
'public' => true, | |
'show_ui' => true, | |
'show_in_menu' => true, | |
'show_in_nav_menus' => false, | |
'show_in_admin_bar' => true, | |
'menu_position' => 5, | |
'menu_icon' => 'dashicons-megaphone', | |
'can_export' => true, | |
'has_archive' => true, | |
'exclude_from_search' => false, | |
'publicly_queryable' => true, | |
'capability_type' => 'page', | |
); | |
register_post_type( 'testimonial', $args ); | |
} | |
add_action( 'init', 'twpb_testimonial_cpt', 0 ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment