Advertisement
Guest User

Untitled

a guest
Apr 11th, 2016
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. <?php
  2. /*Plugin Name: Create Project Post Type
  3. Description: This plugin registers the 'Project' post type.
  4. Version: 1.0
  5. License: GPLv2
  6. */
  7.  
  8. function custom_post_type() {
  9.  
  10. // set up labels
  11. $labels = array(
  12. 'name' => 'Projects',
  13. 'singular_name' => 'Project',
  14. 'add_new' => 'Add New Project',
  15. 'add_new_item' => 'Add New Project',
  16. 'edit_item' => 'Edit Project',
  17. 'new_item' => 'New Project',
  18. 'all_items' => 'All Projects',
  19. 'view_item' => 'View project',
  20. 'search_items' => 'Search Projects',
  21. 'not_found' => 'No Projects Found',
  22. 'not_found_in_trash' => 'No Projects found in Trash',
  23. 'parent_item_colon' => '',
  24. 'menu_name' => 'Projects',
  25. );
  26. //register post type
  27. $args = array (
  28. 'labels' => $labels,
  29. 'has_archive' => false,
  30. 'public' => true,
  31. 'supports' => array( 'title', 'editor', 'thumbnail', 'materials_list', 'step_by_step' ),
  32. 'taxonomies' => array( 'post_tag', 'category' ),
  33. 'exclude_from_search' => false,
  34. 'capability_type' => 'post',
  35. 'rewrite' => array( 'slug' => 'projects' ),
  36. );
  37.  
  38. register_post_type( 'Projects', $args);
  39.  
  40.  
  41.  
  42. }
  43. add_action( 'init', 'custom_post_type', 0 );
  44.  
  45.  
  46.  
  47.  
  48. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement