Guest User

Untitled

a guest
Oct 18th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. /* ---------------------------------------------------------------------------------
  2. * Register Post Type Called Books
  3. * So you can focusing your Book-related content to this Post Type
  4. *
  5. */
  6.  
  7. add_action('init', 'book_post_type');
  8. function book_post_type(){
  9. $labels = array(
  10. 'name' => _x('Books', 'post type general name'),
  11. 'singular_name' => _x('Book', 'post type singular name'),
  12. 'add_new' => _x('Add New', 'book'),
  13. 'add_new_item' => __('Add New Book'),
  14. 'edit_item' => __('Edit Book'),
  15. 'new_item' => __('New Book'),
  16. 'view_item' => __('View Book'),
  17. 'search_items' => __('Search Books'),
  18. 'not_found' => __('No books found'),
  19. 'not_found_in_trash' => __('No books found in Trash'),
  20. 'parent_item_colon' => '',
  21. 'menu_name' => 'Books'
  22. );
  23.  
  24. $args = array(
  25. 'labels' => $labels,
  26. 'public' => true,
  27. 'publicly_queryable' => true,
  28. 'show_ui' => true,
  29. 'show_in_menu' => true,
  30. 'query_var' => true,
  31. 'rewrite' => true,
  32. 'capability_type' => 'post',
  33. 'has_archive' => true,
  34. 'hierarchical' => false,
  35. 'menu_position' => null,
  36. 'supports' => array('title','editor','author','thumbnail','excerpt','comments')
  37. );
  38. register_post_type('book',$args);
  39. }
Add Comment
Please, Sign In to add comment