Advertisement
Guest User

Untitled

a guest
Mar 26th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.41 KB | None | 0 0
  1. <?php
  2. function surrey_post_types() {
  3.  
  4. register_post_type( 'service', array(
  5. 'supports' => array('title', 'editor', 'thumbnail'),
  6. 'public' => true,
  7. 'labels' => array(
  8. 'name' => 'Services',
  9. 'add_new_item' => 'Add New Service',
  10. 'edit_item' => 'Edit Service',
  11. 'all_items' => 'All Services',
  12. 'singular_name' => 'Service',
  13. 'rewrite' => array( 'slug' => 'services' )
  14. ),
  15. 'menu_icon' => 'dashicons-star-filled',
  16. ) );
  17.  
  18. }
  19.  
  20. add_action('init', 'surrey_post_types');
  21.  
  22. // Register Custom Taxonomy
  23. function custom_taxonomy() {
  24.  
  25. $labels = array(
  26. 'name' => _x( 'Service Types', 'Taxonomy General Name', 'text_domain' ),
  27. 'singular_name' => _x( 'Service Type', 'Taxonomy Singular Name', 'text_domain' ),
  28. 'menu_name' => __( 'Service Type', 'text_domain' ),
  29. 'all_items' => __( 'All Items', 'text_domain' ),
  30. 'parent_item' => __( 'Parent Item', 'text_domain' ),
  31. 'parent_item_colon' => __( 'Parent Item:', 'text_domain' ),
  32. 'new_item_name' => __( 'New Item Name', 'text_domain' ),
  33. 'add_new_item' => __( 'Add New Item', 'text_domain' ),
  34. 'edit_item' => __( 'Edit Item', 'text_domain' ),
  35. 'update_item' => __( 'Update Item', 'text_domain' ),
  36. 'view_item' => __( 'View Item', 'text_domain' ),
  37. 'separate_items_with_commas' => __( 'Separate items with commas', 'text_domain' ),
  38. 'add_or_remove_items' => __( 'Add or remove items', 'text_domain' ),
  39. 'choose_from_most_used' => __( 'Choose from the most used', 'text_domain' ),
  40. 'popular_items' => __( 'Popular Items', 'text_domain' ),
  41. 'search_items' => __( 'Search Items', 'text_domain' ),
  42. 'not_found' => __( 'Not Found', 'text_domain' ),
  43. 'no_terms' => __( 'No items', 'text_domain' ),
  44. 'items_list' => __( 'Items list', 'text_domain' ),
  45. 'items_list_navigation' => __( 'Items list navigation', 'text_domain' ),
  46. );
  47. $args = array(
  48. 'labels' => $labels,
  49. 'hierarchical' => false,
  50. 'public' => true,
  51. 'show_ui' => true,
  52. 'show_admin_column' => true,
  53. 'show_in_nav_menus' => true,
  54. 'show_tagcloud' => true,
  55. );
  56. register_taxonomy( 'taxonomy', array( 'service' ), $args );
  57.  
  58. }
  59. add_action( 'init', 'custom_taxonomy', 0 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement