Advertisement
Guest User

Support for Meta Box

a guest
Aug 18th, 2015
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 10.16 KB | None | 0 0
  1. <?php
  2. /**
  3.  * Creating Metaboxes for posts.
  4.  * @return [array]             [Metabox Parameters]
  5.  */
  6. function talent_metaboxes( $meta_boxes )
  7. {
  8.     $prefix = 'talent_';
  9.     // Post Quiz Metaboxes
  10.     $meta_boxes[] = array(
  11.         'title'     => 'Talent Details',
  12.         'id'        => 'talent_attributes',
  13.         //'pages'    => array( 'talent' ),
  14.         'context'   => 'normal',
  15.         'priority'  => 'high',
  16.         'tabs'      => array(
  17.             'about'     => array(
  18.                 'label' => __( 'About', 'rwmb' ),
  19.                 'icon'  => 'dashicons-admin-users', // Dashicon
  20.             ),
  21.             'resume'    => array(
  22.                 'label' => __( 'Resume', 'rwmb' ),
  23.                 'icon'  => 'dashicons-welcome-learn-more', // Dashicon
  24.             ),
  25.             'work'      => array(
  26.                 'label' => __( 'Work', 'rwmb' ),
  27.                 'icon'  => 'dashicons-admin-page', // Dashicon
  28.             ),
  29.             'photos'    => array(
  30.                 'label' => __( 'Photos', 'rwmb' ),
  31.                 'icon'  => 'dashicons-format-gallery', // Dashicon
  32.             ),
  33.             'ie-resume' => array(
  34.                 'label' => __( 'Import/Export Resume', 'rwmb' ),
  35.                 'icon'  => 'dashicons-media-default', // Dashicon
  36.             ),
  37.         ),
  38.  
  39.         // Tab style: 'default', 'box' or 'left'. Optional
  40.         'tab_style' => 'box',
  41.         'fields'    => array(
  42.             /* ABOUT TAB */
  43.             array(
  44.                 'name'    => 'First Name',
  45.                 'desc'    => '',
  46.                 'id'      => $prefix . 'first_name',
  47.                 'type'    => 'text',
  48.                 'class'   => 'talent-details talent_first_name',
  49.                 'clone'   => false,
  50.                 'columns' => 3,
  51.                 'tab'     => 'about'
  52.             ),
  53.  
  54.             array(
  55.                 'name'    => 'Last Name',
  56.                 'desc'    => '',
  57.                 'id'      => $prefix . 'last_name',
  58.                 'type'    => 'text',
  59.                 'class'   => 'talent-details talent_last_name',
  60.                 'clone'   => false,
  61.                 'columns' => 3,
  62.                 'tab'     => 'about'
  63.             ),
  64.             array(
  65.                 'name'    => 'Active',
  66.                 'desc'    => '',
  67.                 'id'      => $prefix . 'active',
  68.                 'type'    => 'checkbox',
  69.                 'class'   => 'talent-details talent_active',
  70.                 'clone'   => false,
  71.                 'columns' => 2,
  72.                 'tab'     => 'about'
  73.             ),
  74.             array(
  75.                 'name'    => 'Featured',
  76.                 'desc'    => '',
  77.                 'id'      => $prefix . 'featured',
  78.                 'type'    => 'checkbox',
  79.                 'class'   => 'talent-details talent_featured',
  80.                 'clone'   => false,
  81.                 'columns' => 2,
  82.                 'tab'     => 'about'
  83.             ),
  84.             array(
  85.                 'name'    => 'Hide Age',
  86.                 'desc'    => '',
  87.                 'id'      => $prefix . 'hide_age',
  88.                 'type'    => 'checkbox',
  89.                 'class'   => 'talent-details talent_hide_age',
  90.                 'clone'   => false,
  91.                 'columns' => 2,
  92.                 'tab'     => 'about'
  93.             ),
  94.  
  95.             array(
  96.                 'name'    => 'Description',
  97.                 'desc'    => '',
  98.                 'id'      => $prefix . 'description',
  99.                 'type'    => 'wysiwyg',
  100.                 'class'   => 'talent-details talent_description',
  101.                 'clone'   => false,
  102.                 'columns' => 12,
  103.                 'tab'     => 'about'
  104.             ),
  105.             array(
  106.                 'name'        => 'Gender',
  107.                 'desc'        => '',
  108.                 'id'          => $prefix . 'gender',
  109.                 'type'        => 'select',
  110.                 'options'     => array(
  111.                     'male'   => 'Male',
  112.                     'female' => 'Female',
  113.                 ),
  114.                 'placeholder' => 'Select',
  115.                 'class'       => 'talent-details talent_gender',
  116.                 'clone'       => false,
  117.                 'columns'     => 4,
  118.                 'tab'         => 'about'
  119.             ),
  120.             array(
  121.                 'name'        => 'Ethnicity',
  122.                 'desc'        => '',
  123.                 'id'          => $prefix . 'ethnicity',
  124.                 'type'        => 'select',
  125.                 'options'     => array(
  126.                     'African American' => 'African American',
  127.                     'Asian'            => 'Asian',
  128.                     'Caucasian'        => 'Caucasian',
  129.                     'Latino'           => 'Latino',
  130.                     'Other'            => 'Other',
  131.                 ),
  132.                 'placeholder' => 'Select',
  133.                 'class'       => 'talent-details talent_ethnicity',
  134.                 'clone'       => false,
  135.                 'columns'     => 4,
  136.                 'tab'         => 'about'
  137.             ),
  138.             array(
  139.                 'name'        => 'Secondary Ethnicity',
  140.                 'desc'        => '',
  141.                 'id'          => $prefix . 'secondary_ethnicity',
  142.                 'type'        => 'select',
  143.                 'options'     => array(
  144.                     'African American' => 'African American',
  145.                     'Asian'            => 'Asian',
  146.                     'Caucasian'        => 'Caucasian',
  147.                     'Latino'           => 'Latino',
  148.                     'Other'            => 'Other',
  149.                 ),
  150.                 'placeholder' => 'Select',
  151.                 'class'       => 'talent-details talent_secondary_ethnicity',
  152.                 'clone'       => false,
  153.                 'columns'     => 4,
  154.                 'tab'         => 'about'
  155.             ),
  156.             array(
  157.                 'name'        => 'Tertiary Ethnicity',
  158.                 'desc'        => '',
  159.                 'id'          => $prefix . 'tertiary_ethnicity',
  160.                 'type'        => 'select',
  161.                 'options'     => array(
  162.                     'African American' => 'African American',
  163.                     'Asian'            => 'Asian',
  164.                     'Caucasian'        => 'Caucasian',
  165.                     'Latino'           => 'Latino',
  166.                     'Other'            => 'Other',
  167.                 ),
  168.                 'placeholder' => 'Select',
  169.                 'class'       => 'talent-details talent_tertiary_ethnicity',
  170.                 'clone'       => false,
  171.                 'columns'     => 4,
  172.                 'tab'         => 'about'
  173.             ),
  174.             array(
  175.                 'name'        => 'Hair Color',
  176.                 'desc'        => '',
  177.                 'id'          => $prefix . 'hair_color',
  178.                 'type'        => 'select',
  179.                 'options'     => array(
  180.                     'Black'         => 'Black',
  181.                     'Blonde'        => 'Blonde',
  182.                     'Brown'         => 'Brown',
  183.                     'Grey'          => 'Grey',
  184.                     'Red'           => 'Red',
  185.                     'Salt & Pepper' => 'Salt & Pepper',
  186.                     'White'         => 'White',
  187.                 ),
  188.                 'placeholder' => 'Select',
  189.                 'class'       => 'talent-details talent_hair_color',
  190.                 'clone'       => false,
  191.                 'columns'     => 4,
  192.                 'tab'         => 'about'
  193.             ),
  194.             array(
  195.                 'name'        => 'Eye color',
  196.                 'desc'        => '',
  197.                 'id'          => $prefix . 'eye_color',
  198.                 'type'        => 'select',
  199.                 'options'     => array(
  200.                     'Black' => 'Black',
  201.                     'Blue'  => 'Blue',
  202.                     'Brown' => 'Brown',
  203.                     'Green' => 'Green',
  204.                     'Grey'  => 'Grey',
  205.                     'Hazel' => 'Hazel',
  206.                 ),
  207.                 'placeholder' => 'Select',
  208.                 'class'       => 'talent-details talent_eye_color',
  209.                 'clone'       => false,
  210.                 'columns'     => 4,
  211.                 'tab'         => 'about'
  212.             ),
  213.             array(
  214.                 'name'    => 'DOB',
  215.                 'desc'    => '',
  216.                 'id'      => $prefix . 'dob',
  217.                 'type'    => 'date',
  218.                 'class'   => 'talent-details talent_dob',
  219.                 'clone'   => false,
  220.                 'columns' => 4,
  221.                 'tab'     => 'about'
  222.             ),
  223.             array(
  224.                 'name'        => 'Additional Range',
  225.                 'desc'        => '',
  226.                 'id'          => $prefix . 'additional_range',
  227.                 'type'        => 'select',
  228.                 'options'     => array(
  229.                     'Can play younger' => 'Can play younger',
  230.                     'Can play older'   => 'Can play older',
  231.                 ),
  232.                 'placeholder' => 'Select',
  233.                 'class'       => 'talent-details talent_additional_range',
  234.                 'clone'       => false,
  235.                 'columns'     => 4,
  236.                 'tab'         => 'about'
  237.             ),
  238.             array(
  239.                 'name'    => 'Height',
  240.                 'desc'    => '',
  241.                 'id'      => $prefix . 'height',
  242.                 'type'    => 'text',
  243.                 'class'   => 'talent-details talent_height',
  244.                 'clone'   => false,
  245.                 'columns' => 4,
  246.                 'tab'     => 'about'
  247.             ),
  248.             array(
  249.                 'name'    => 'Weight (lbs)',
  250.                 'desc'    => '',
  251.                 'id'      => $prefix . 'weight',
  252.                 'type'    => 'text',
  253.                 'class'   => 'talent-details talent_weight',
  254.                 'clone'   => false,
  255.                 'columns' => 4,
  256.                 'tab'     => 'about'
  257.             ),
  258.             array(
  259.                 'name'    => 'Website',
  260.                 'desc'    => '',
  261.                 'id'      => $prefix . 'website',
  262.                 'type'    => 'url',
  263.                 'class'   => 'talent-details talent_website',
  264.                 'clone'   => false,
  265.                 'columns' => 4,
  266.                 'tab'     => 'about'
  267.             ),
  268.             array(
  269.                 'type'    => 'custom_html',
  270.                 'std'     => '',
  271.                 'columns' => 4,
  272.                 'tab'     => 'about'
  273.             ),
  274.             /* RESUME TAB */
  275.             array(
  276.                 'name'       => 'Header',
  277.                 'desc'       => '',
  278.                 'id'         => $prefix . 'resume_header',
  279.                 'type'       => 'text',
  280.                 'class'      => '',
  281.                 'clone'      => true,
  282.                 'sort_clone' => true,
  283.                 'columns'    => 12,
  284.                 'tab'        => 'resume'
  285.             ),
  286.             array(
  287.                 'name'       => '',
  288.                 'desc'       => '',
  289.                 'id'         => $prefix . 'resume_data',
  290.                 'type'       => 'text',
  291.                 'class'      => '',
  292.                 'clone'      => true,
  293.                 'sort_clone' => true,
  294.                 'columns'    => 4,
  295.                 'tab'        => 'resume'
  296.             ),
  297.             array(
  298.                 'name'       => '',
  299.                 'desc'       => '',
  300.                 'id'         => $prefix . 'resume_data',
  301.                 'type'       => 'text',
  302.                 'class'      => '',
  303.                 'clone'      => true,
  304.                 'sort_clone' => true,
  305.                 'columns'    => 4,
  306.                 'tab'        => 'resume'
  307.             ),
  308.             array(
  309.                 'name'       => '',
  310.                 'desc'       => '',
  311.                 'id'         => $prefix . 'resume_data',
  312.                 'type'       => 'text',
  313.                 'class'      => '',
  314.                 'clone'      => true,
  315.                 'sort_clone' => true,
  316.                 'columns'    => 4,
  317.                 'tab'        => 'resume'
  318.             ),
  319.             /* WORK TAB */
  320.             array(
  321.                 'name'  => 'Voice Over',
  322.                 'desc'  => '',
  323.                 'id'    => $prefix . 'work_voiceover',
  324.                 'type'  => 'file',
  325.                 'class' => 'talent-details talent_work_voiceover',
  326.                 'clone' => false,
  327.                 'tab'   => 'work'
  328.             ),
  329.             array(
  330.                 'name'       => 'Theatrical Reel',
  331.                 'desc'       => '',
  332.                 'id'         => $prefix . 'work_theatrical_reel',
  333.                 'type'       => 'url',
  334.                 'class'      => 'talent-details talent_work_theatrical_reel',
  335.                 'clone'      => false,
  336.                 'sort_clone' => false,
  337.                 'tab'        => 'work'
  338.             ),
  339.             array(
  340.                 'name'       => 'Commercial Reel',
  341.                 'desc'       => '',
  342.                 'id'         => $prefix . 'work_commercial_reel',
  343.                 'type'       => 'url',
  344.                 'class'      => 'talent-details talent_work_commercial_reel',
  345.                 'clone'      => false,
  346.                 'sort_clone' => false,
  347.                 'tab'        => 'work'
  348.             ),
  349.             array(
  350.                 'name'       => 'Hosting Reel',
  351.                 'desc'       => '',
  352.                 'id'         => $prefix . 'work_hosting_reel',
  353.                 'type'       => 'url',
  354.                 'class'      => 'talent-details talent_work_commercial_reel',
  355.                 'clone'      => false,
  356.                 'sort_clone' => false,
  357.                 'tab'        => 'work'
  358.             ),
  359.             /* PHOTOS TAB */
  360.             array(
  361.                 'name'  => 'Photos',
  362.                 'desc'  => '',
  363.                 'id'    => $prefix . 'work_voiceover',
  364.                 'type'  => 'image_advanced',
  365.                 'class' => 'talent-details talent_work_voiceover',
  366.                 'clone' => false,
  367.                 'tab'   => 'photos'
  368.             ),
  369.         )
  370.     );
  371.     return $meta_boxes;
  372. }
  373.  
  374. add_filter( 'rwmb_meta_boxes', 'talent_metaboxes' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement