Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*Plugin Name: Create Project Post Type
- Description: This plugin registers the 'Project' post type.
- Version: 1.0
- License: GPLv2
- */
- function custom_post_type() {
- // set up labels
- $labels = array(
- 'name' => 'Projects',
- 'singular_name' => 'Project',
- 'add_new' => 'Add New Project',
- 'add_new_item' => 'Add New Project',
- 'edit_item' => 'Edit Project',
- 'new_item' => 'New Project',
- 'all_items' => 'All Projects',
- 'view_item' => 'View project',
- 'search_items' => 'Search Projects',
- 'not_found' => 'No Projects Found',
- 'not_found_in_trash' => 'No Projects found in Trash',
- 'parent_item_colon' => '',
- 'menu_name' => 'Projects',
- );
- //register post type
- $args = array (
- 'labels' => $labels,
- 'has_archive' => false,
- 'public' => true,
- 'supports' => array( 'title', 'editor', 'thumbnail', 'materials_list', 'step_by_step' ),
- 'taxonomies' => array( 'post_tag', 'category' ),
- 'exclude_from_search' => false,
- 'capability_type' => 'post',
- 'rewrite' => array( 'slug' => 'projects' ),
- );
- register_post_type( 'Projects', $args);
- }
- add_action( 'init', 'custom_post_type', 0 );
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement