Advertisement
Guest User

Untitled

a guest
Sep 4th, 2017
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.27 KB | None | 0 0
  1. add_filter( 'rwmb_meta_boxes', 'gnl_partner_post_box' );
  2. function gnl_partner_post_box( $meta_boxes ) {
  3. global $sites, $clients_array, $cats_array;
  4. $prefix = 'gnl_post_attributes_';
  5. // 1st meta box
  6. $meta_boxes[] = array(
  7. 'id' => 'post_attributes_box',
  8. 'title' => __( 'Post Attributes', 'textdomain' ),
  9. 'post_types' => array( 'post', 'gnl_events'),
  10. 'context' => 'side',
  11. 'priority' => 'high',
  12. 'fields' => array(
  13. array(
  14. 'id' => $prefix . 'alias',
  15. 'type' => 'taxonomy',
  16. 'name' => esc_html__( 'Author Alias/Contributor', 'metabox-online-generator' ),
  17. 'desc' => esc_html__( 'Select Alias', 'metabox-online-generator' ),
  18. 'taxonomy' => 'contributor',
  19. 'field_type' => 'select_advanced',
  20. 'multiple' => true,
  21.  
  22. ),
  23. array(
  24. 'id' => $prefix . 'sections',
  25. 'type' => 'taxonomy',
  26. 'name' => esc_html__( 'Category', 'metabox-online-generator' ),
  27. 'desc' => esc_html__( 'Select Category', 'metabox-online-generator' ),
  28. 'taxonomy' => 'section',
  29. 'field_type' => 'select_tree',
  30. //'admin_columns' => true,
  31.  
  32.  
  33. ),
  34. array(
  35. 'id' => $prefix . 'tags',
  36. 'type' => 'taxonomy',
  37. 'name' => esc_html__( 'Tags', 'metabox-online-generator' ),
  38. 'desc' => esc_html__( 'Apply Tags', 'metabox-online-generator' ),
  39. 'taxonomy' => 'tag',
  40. 'field_type' => 'select_advanced',
  41. 'multiple' => true,
  42. ),
  43. array(
  44. 'name' => __( 'Partners:', 'textdomain' ),
  45. 'desc' => 'Add partners. List generated from the Intranet',
  46. 'id' => $prefix . 'partners',
  47. 'type' => 'select_advanced',
  48. 'class' => 'client-box-class',
  49. 'options' => $clients_array,
  50. 'multiple' => true,
  51.  
  52. ),
  53. array(
  54. 'id' => $prefix . 'cities',
  55. 'type' => 'taxonomy',
  56. 'name' => esc_html__( 'Cities', 'metabox-online-generator' ),
  57. 'desc' => esc_html__( 'Select Cities', 'metabox-online-generator' ),
  58. 'taxonomy' => 'city',
  59. 'field_type' => 'checkbox_list',
  60. 'multiple' => true,
  61.  
  62. ),
  63.  
  64. array(
  65. 'name' => __( 'Locations/Venues:', 'textdomain' ),
  66. 'desc' => 'Add Locations associated to this post',
  67. 'id' => $prefix . 'locations',
  68. 'type' => 'post',
  69. 'class' => 'client-box-class',
  70. 'post_type' => 'gnl_locations',
  71. 'field_type' => 'select_advanced',
  72. 'multiple' => true,
  73.  
  74. ),
  75. array(
  76. 'id' => $prefix . 'rating',
  77. 'name' => esc_html__( 'Importance Rating:', 'textdomain' ),
  78. 'type' => 'select',
  79. 'placeholder' => esc_html__( 'Select Rating', 'textdomain' ),
  80. 'options' => array(
  81. 1 => '1 - High',
  82. '2 - Normal',
  83. '3 - Low',
  84. ),
  85. 'std' => '2',
  86. ),
  87. array(
  88. 'id' => $prefix . 'featured',
  89. 'name' => esc_html__( 'Featured Post', 'textdomain' ),
  90. 'type' => 'checkbox',
  91. 'desc' => esc_html__( 'Yes, This is Featured', 'textdomain' ),
  92. ),
  93. ),
  94. );
  95.  
  96. return $meta_boxes;
  97. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement