Advertisement
rdusnr

Untitled

Sep 18th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.86 KB | None | 0 0
  1. <?php
  2.  
  3. /*
  4. * Clients Post type creation class
  5. *
  6. */
  7.  
  8.  
  9. class Clients_Post_Type extends Post_types {
  10.  
  11. public function __construct() {
  12. $this->labels = array();
  13. $this->labels['clients'] = array( 'singular' => __( 'Client', 'kleo_framework' ), 'plural' => __( 'Clients', 'kleo_framework' ), 'menu' => __( 'Clients', 'kleo_framework' ) );
  14.  
  15. add_action( 'init', array( &$this, 'setup_post_type' ), 7 );
  16. }
  17.  
  18. /**
  19. * Setup Clients post type
  20. * @since 1.0
  21. * @return void
  22. */
  23. public function setup_post_type () {
  24.  
  25. $args = array(
  26. 'labels' => $this->get_labels( 'clients', $this->labels['clients']['singular'], $this->labels['clients']['plural'], $this->labels['clients']['menu'] ),
  27. 'public' => true,
  28. 'publicly_queryable' => true,
  29. 'show_ui' => true,
  30. 'show_in_menu' => TRUE,
  31. 'menu_icon' => 'dashicons-businessman',
  32. 'query_var' => true,
  33. 'rewrite' => array( 'slug' => esc_attr( apply_filters( 'kleo_clients_slug', 'clients' ) )),
  34. 'has_archive' => true,
  35. 'hierarchical' => false,
  36. 'menu_position' => 20, // Below "Pages"
  37. 'supports' => apply_filters( kleo_clients_cpt_supports, array('title', 'thumbnail') )
  38. );
  39.  
  40. register_post_type( 'kleo_clients', $args );
  41.  
  42. $tag_args = array(
  43. "label" => _x('Client Tags', 'tag label', "kleo_framework"),
  44. "singular_label" => _x('Client Tag', 'tag singular label', "kleo_framework"),
  45. 'public' => true,
  46. 'hierarchical' => false,
  47. 'show_ui' => true,
  48. 'show_in_nav_menus' => false,
  49. 'args' => array( 'orderby' => 'term_order' ),
  50. 'query_var' => true
  51. );
  52.  
  53. register_taxonomy( 'clients-tag', 'kleo_clients', $tag_args );
  54.  
  55. } // End setup_clients_post_type()
  56.  
  57. }
  58.  
  59.  
  60. $kleo_clients = new Clients_Post_Type();
  61. Kleo::set_module( 'clients', $kleo_clients );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement