Advertisement
Guest User

Untitled

a guest
Apr 20th, 2018
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.24 KB | None | 0 0
  1. <?php
  2. // meta box for Testimonials - Featured
  3. $meta_boxes[] = [
  4.         'title'  => esc_html__( 'Featured Video &amp; Quote Testimonials', 'lhk' ),
  5.         'post_types' =>   [
  6.          'page',
  7.         ],
  8.         'context' => 'after_title',
  9.         'priority' => 'default',
  10.         'autosave' => false,
  11.         'include' =>   [
  12.           'relation' => 'AND',
  13.           'template' =>     [
  14.             'templates/template-testimonials.php',
  15.           ],
  16.  
  17. `    ],
  18.     'fields' => [
  19.                 [
  20.                     'type' => 'heading',
  21.                     'name' =>  esc_html__( 'This group of video and text quotes will appear on the top of the page, just below the page heading', 'lhk' ),
  22.                 ],
  23.                 [
  24.                     'id'     => 'group_featured_video',
  25.                     'type'   => 'group',
  26.                     'clone'  => true,
  27.                     'sort_clone' => true,
  28.                     'collapsible' => true,
  29.                     'group_title' => esc_html__( 'Featured Video Testimonial', 'lhk' ), // ID of the subfield
  30.                     'save_state' => true,
  31.                     'add_button'  => esc_html__( 'Add Featured Video', 'lhk' ),
  32.                     'fields' => [
  33.                         [
  34.                             'id' => 'featured_title',
  35.                             'type' => 'text',
  36.                             'name' => esc_html__('Video Title', 'lhk'),
  37.                             'desc' => esc_html__('Please insert your text in the box.','lhk'),
  38.                             'size' => 85,
  39.                         ],
  40.                        [
  41.                             'id' => 'featured_url',
  42.                             'type' => 'text',
  43.                             'name' => esc_html__('Video URL', 'lhk'),
  44.                             'desc' => esc_html__('Please insert video url address','lhk'),
  45.                             'size' => 85,
  46.                        ],
  47.                     ],
  48.                 ],
  49.                 [
  50.                     'id'     => 'group_featured_quote',
  51.                     'type'   => 'group',
  52.                     'clone'  => true,
  53.                     'sort_clone' => true,
  54.                     'collapsible' => true,
  55.                     'group_title' => esc_html__( 'Featured Quote Testimonial', 'lhk' ), // ID of the subfield
  56.                     'save_state' => true,
  57.                     'add_button'  => esc_html__( 'Add Featured Quote', 'lhk' ),
  58.                     'fields' => [
  59.                         [
  60.                             'id' => 'featured_text',
  61.                             'type' => 'textarea',
  62.                             'name' => esc_html__('Quote Text', 'lhk'),
  63.                             'desc' => esc_html__('Please insert your text in the box.','lhk'),
  64.                             'cols' => 50,
  65.                             'rows' => 3,
  66.                         ],
  67.                         [
  68.                             'id' => 'featured_author',
  69.                             'type' => 'text',
  70.                             'name' => esc_html__('Author', 'lhk'),
  71.                             'desc' => esc_html__('Please insert your text in the box.','lhk'),
  72.                             'size' => 65,
  73.                         ],
  74.                          [
  75.                             'id' => 'featured_company',
  76.                             'type' => 'text',
  77.                             'name' => esc_html__('Company', 'lhk'),
  78.                             'desc' => esc_html__('Please insert your text in the box.','lhk'),
  79.                             'size' => 85,
  80.                         ],
  81.                        [
  82.                             'id' => 'featured_image',
  83.                             'type' => 'single_image',
  84.                             'name' => esc_html__('Logo/Image', 'lhk'),
  85.                             'desc' => esc_html__('Please upload the image.','lhk'),
  86.                        ],                  
  87.  
  88.                 ],
  89.  
  90.         ],
  91.  
  92.     ],
  93.     'validation' => [
  94.         'rules' => [
  95.             'group_featured_video' => [
  96.                 'featured_url' =>[
  97.                     'url' => true,
  98.                     'only_videos' => true,
  99.                 ],                  
  100.             ],
  101.         ],
  102.     ],
  103.  
  104. ];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement