Created
October 26, 2016 18:27
-
-
Save jeremyjaymes/8a1525187a6c2fc0020935150e461af8 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
/** | |
* Slides Custom Post Type | |
* | |
* Register a slides custom post type for those that insist. | |
* Useful when slides don't belong as posts or pages. Can be used with | |
* a plugin, e.g. Genesis Responsive Slider or a custom implementation. | |
* | |
* Does not currently include post content, only the excerpt. | |
*/ | |
// Register Slides Custom Post Type | |
function pm_slides_cpt() { | |
$labels = array( | |
'name' => _x( 'Slide', 'Post Type General Name', 'pm' ), | |
'singular_name' => _x( 'Slide', 'Post Type Singular Name', 'pm' ), | |
'menu_name' => __( 'Slides', 'pm' ), | |
'name_admin_bar' => __( 'Slide', 'pm' ), | |
'archives' => __( 'Slide Archives', 'pm' ), | |
'parent_item_colon' => __( 'Parent Slide:', 'pm' ), | |
'all_items' => __( 'All Slides', 'pm' ), | |
'add_new_item' => __( 'Add New Slide', 'pm' ), | |
'add_new' => __( 'Add New', 'pm' ), | |
'new_item' => __( 'New Slide', 'pm' ), | |
'edit_item' => __( 'Edit Slide', 'pm' ), | |
'update_item' => __( 'Update Slide', 'pm' ), | |
'view_item' => __( 'View Slide', 'pm' ), | |
'search_items' => __( 'Search Slides', 'pm' ), | |
'not_found' => __( 'Not found', 'pm' ), | |
'not_found_in_trash' => __( 'Not found in Trash', 'pm' ), | |
'featured_image' => __( 'Featured Image', 'pm' ), | |
'set_featured_image' => __( 'Set featured image', 'pm' ), | |
'remove_featured_image' => __( 'Remove featured image', 'pm' ), | |
'use_featured_image' => __( 'Use as featured image', 'pm' ), | |
'insert_into_item' => __( 'Insert into slide', 'pm' ), | |
'uploaded_to_this_item' => __( 'Uploaded to this slide', 'pm' ), | |
'items_list' => __( 'Slides list', 'pm' ), | |
'items_list_navigation' => __( 'Slides list navigation', 'pm' ), | |
'filter_items_list' => __( 'Filter slides list', 'pm' ), | |
); | |
$args = array( | |
'label' => __( 'Slide', 'pm' ), | |
'description' => __( 'Custom Slideshow Images', 'pm' ), | |
'labels' => $labels, | |
'supports' => array( 'title', 'excerpt', 'thumbnail', 'revisions', 'custom-fields', ), | |
'hierarchical' => false, | |
'public' => true, | |
'show_ui' => true, | |
'show_in_menu' => true, | |
'menu_position' => 10, | |
'menu_icon' => 'dashicons-camera', | |
'show_in_admin_bar' => true, | |
'show_in_nav_menus' => false, | |
'can_export' => true, | |
'has_archive' => false, | |
'exclude_from_search' => true, | |
'publicly_queryable' => true, | |
'rewrite' => false, | |
'capability_type' => 'page', | |
); | |
register_post_type( 'slides', $args ); | |
} | |
add_action( 'init', 'pm_slides_cpt', 0 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment