Header Ads

Header ADS

3 Custom post type regsiter for wordpress plugin

 

3.Custom post type regsiter for plugin


/*

*

*Register custom post types for plugin

*

*/ 


if ( ! function_exists('nwpt_custom_post_type') ) {


// Register Custom Post Type

function nwpt_custom_post_type() {


$labels = array(

'name'                  => _x( 'Testimonials', 'Post Type General Name', 'nwpt' ),

'singular_name'         => _x( 'Testimonial Type', 'Post Type Singular Name', 'nwpt' ),

'menu_name'             => __( 'Testimonial', 'nwpt' ),

'name_admin_bar'        => __( 'Post Type', 'nwpt' ),

'archives'              => __( 'Item Archives', 'nwpt' ),

'attributes'            => __( 'Item Attributes', 'nwpt' ),

'parent_item_colon'     => __( 'Parent Item:', 'nwpt' ),

'all_items'             => __( 'All Items', 'nwpt' ),

'add_new_item'          => __( 'Add New Item', 'nwpt' ),

'add_new'               => __( 'Add New', 'nwpt' ),

'new_item'              => __( 'New Item', 'nwpt' ),

'edit_item'             => __( 'Edit Item', 'nwpt' ),

'update_item'           => __( 'Update Item', 'nwpt' ),

'view_item'             => __( 'View Item', 'nwpt' ),

'view_items'            => __( 'View Items', 'nwpt' ),

'search_items'          => __( 'Search Item', 'nwpt' ),

'not_found'             => __( 'Not found', 'nwpt' ),

'not_found_in_trash'    => __( 'Not found in Trash', 'nwpt' ),

'featured_image'        => __( 'Featured Image', 'nwpt' ),

'set_featured_image'    => __( 'Set featured image', 'nwpt' ),

'remove_featured_image' => __( 'Remove featured image', 'nwpt' ),

'use_featured_image'    => __( 'Use as featured image', 'nwpt' ),

'insert_into_item'      => __( 'Insert into item', 'nwpt' ),

'uploaded_to_this_item' => __( 'Uploaded to this item', 'nwpt' ),

'items_list'            => __( 'Items list', 'nwpt' ),

'items_list_navigation' => __( 'Items list navigation', 'nwpt' ),

'filter_items_list'     => __( 'Filter items list', 'nwpt' ),

);

$args = array(

'label'                 => __( 'Testimonial Type', 'nwpt' ),

'description'           => __( 'Testimonial Description', 'nwpt' ),

'labels'                => $labels,

'supports'              => array( 'title', 'editor', 'thumbnail', 'custom-fields' ),

'hierarchical'          => false,

'public'                => true,

'show_ui'               => true,

'show_in_menu'          => true,

'show_in_admin_bar'     => true,

'show_in_nav_menus'     => true,

'can_export'            => true,

'has_archive'           => true,

'exclude_from_search'   => false,

'publicly_queryable'    => true,

'capability_type'       => 'page',

);

register_post_type( 'testimonial', $args );


}

add_action( 'init', 'nwpt_custom_post_type', 0 );


}

No comments

Theme images by fpm. Powered by Blogger.