Guest User

Untitled

a guest
Oct 19th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.99 KB | None | 0 0
  1. function sw_xicon_metaboxes( $meta_boxes )
  2. {
  3.  
  4.     $meta_boxes[] = array(
  5.         'title'     => __( 'Project Information', 'sw_xicon_language' ),
  6.         'post_types' => array( 'projects' ),
  7.         'context'    => 'normal',
  8.         'priority'   => 'high',
  9.  
  10.         'tabs'      => array(
  11.             'descriptions'    => array(
  12.                 'label' => __( 'Description', 'sw_xicon_language' ),
  13.                 'icon'  => 'dashicons-edit',
  14.             ),
  15.             'reports' => array(
  16.                 'label' => __( 'Stock Reports', 'sw_xicon_language' ),
  17.                 'icon'  => 'dashicons-analytics',
  18.             ),
  19.             'jobs'  => array(
  20.                 'label' => __( 'Job Cards', 'sw_xicon_language' ),
  21.                 'icon'  => 'dashicons-clipboard',
  22.             ),
  23.             'schedules'    => array(
  24.                 'label' => __( 'Schedule', 'sw_xicon_language' ),
  25.                 'icon'  => 'dashicons-calendar',
  26.             ),
  27.         ),
  28.  
  29.         'tab_style' => 'box',
  30.  
  31.         'tab_wrapper' => true,
  32.         'fields'    => array(
  33.             array(
  34.                 'name'  => __( 'Project Description', 'sw_xicon_language' ),
  35.                 'id'    => 'project_description',
  36.                 'type'  => 'wysiwyg',
  37.                 'tab'   => 'descriptions',
  38.             ),
  39.             array(
  40.                 'name'  => __( 'Stock Report Files', 'sw_xicon_language' ),
  41.                 'id'    => 'stock_reports',
  42.                 'type'  => 'file_input',
  43.                 'tab'   => 'reports',
  44.                 'clone' => 'true',
  45.                 'sort_clone' => 'true',
  46.             ),
  47.             array(
  48.                 'name'  => __( 'Job Card Files', 'sw_xicon_language' ),
  49.                 'id'    => 'job_cards',
  50.                 'type'  => 'file_input',
  51.                 'tab'   => 'jobs',
  52.                 'clone' => 'true',
  53.                 'sort_clone' => 'true',
  54.             ),
  55.  
  56.            
  57.            
  58.             array(
  59.                 'id'     => 'job_schedules',
  60.                 'type'   => 'group',
  61.                 'clone'  => true,
  62.                 'sort_clone' => true,
  63.                 'tab'   => 'schedules',
  64.  
  65.                 'fields' => array(
  66.                     array(
  67.                         'name' => __( 'Job Title', 'sw_xicon_language' ),
  68.                         'id'   => 'job_title',
  69.                         'type' => 'text',
  70.                         'columns' => 12,
  71.                     ),
  72.                     array(
  73.                         'name' => __( 'Start Date', 'sw_xicon_language' ),
  74.                         'id'   => 'start_date',
  75.                         'type' => 'date',
  76.                         'columns' => 6,
  77.                     ),
  78.                     array(
  79.                         'name' => __( 'End Date', 'sw_xicon_language' ),
  80.                         'id'   => 'end_date',
  81.                         'type' => 'date',
  82.                         'columns' => 6,
  83.                     ),
  84.                 ),
  85.             ),            
  86.            
  87.            
  88.            
  89.            
  90.            
  91.            
  92.         ),
  93.     );
  94.     $meta_boxes[] = array(
  95.         'title'  => __( 'Project Client', 'sw_xicon_language' ),
  96.         'post_types' => array( 'projects' ),
  97.         'context'    => 'side',
  98.         'priority'   => 'low',
  99.         'fields' => array(
  100.             array(
  101.                 'id'                => 'xicon_cleint',
  102.                 'name'              => __( 'Client', 'sw_xicon_language' ),
  103.                 'type'              => 'user',
  104.                 'field_type'        => 'select_advanced',
  105.                 'placeholder'       => __( 'Select the Client', 'sw_xicon_language' ),
  106.                 'query_args'        => array( 'role' => 'xicon_client')
  107.             ),
  108.         ),
  109.     );
  110.    
  111.     return $meta_boxes;
  112. }
  113. add_filter( 'rwmb_meta_boxes', 'sw_xicon_metaboxes' );
Add Comment
Please, Sign In to add comment