Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // meta box for Testimonials - Featured
- $meta_boxes[] = [
- 'title' => esc_html__( 'Featured Video & Quote Testimonials', 'lhk' ),
- 'post_types' => [
- 'page',
- ],
- 'context' => 'after_title',
- 'priority' => 'default',
- 'autosave' => false,
- 'include' => [
- 'relation' => 'AND',
- 'template' => [
- 'templates/template-testimonials.php',
- ],
- ` ],
- 'fields' => [
- [
- 'type' => 'heading',
- 'name' => esc_html__( 'This group of video and text quotes will appear on the top of the page, just below the page heading', 'lhk' ),
- ],
- [
- 'id' => 'group_featured_video',
- 'type' => 'group',
- 'clone' => true,
- 'sort_clone' => true,
- 'collapsible' => true,
- 'group_title' => esc_html__( 'Featured Video Testimonial', 'lhk' ), // ID of the subfield
- 'save_state' => true,
- 'add_button' => esc_html__( 'Add Featured Video', 'lhk' ),
- 'fields' => [
- [
- 'id' => 'featured_title',
- 'type' => 'text',
- 'name' => esc_html__('Video Title', 'lhk'),
- 'desc' => esc_html__('Please insert your text in the box.','lhk'),
- 'size' => 85,
- ],
- [
- 'id' => 'featured_url',
- 'type' => 'text',
- 'name' => esc_html__('Video URL', 'lhk'),
- 'desc' => esc_html__('Please insert video url address','lhk'),
- 'size' => 85,
- ],
- ],
- ],
- [
- 'id' => 'group_featured_quote',
- 'type' => 'group',
- 'clone' => true,
- 'sort_clone' => true,
- 'collapsible' => true,
- 'group_title' => esc_html__( 'Featured Quote Testimonial', 'lhk' ), // ID of the subfield
- 'save_state' => true,
- 'add_button' => esc_html__( 'Add Featured Quote', 'lhk' ),
- 'fields' => [
- [
- 'id' => 'featured_text',
- 'type' => 'textarea',
- 'name' => esc_html__('Quote Text', 'lhk'),
- 'desc' => esc_html__('Please insert your text in the box.','lhk'),
- 'cols' => 50,
- 'rows' => 3,
- ],
- [
- 'id' => 'featured_author',
- 'type' => 'text',
- 'name' => esc_html__('Author', 'lhk'),
- 'desc' => esc_html__('Please insert your text in the box.','lhk'),
- 'size' => 65,
- ],
- [
- 'id' => 'featured_company',
- 'type' => 'text',
- 'name' => esc_html__('Company', 'lhk'),
- 'desc' => esc_html__('Please insert your text in the box.','lhk'),
- 'size' => 85,
- ],
- [
- 'id' => 'featured_image',
- 'type' => 'single_image',
- 'name' => esc_html__('Logo/Image', 'lhk'),
- 'desc' => esc_html__('Please upload the image.','lhk'),
- ],
- ],
- ],
- ],
- 'validation' => [
- 'rules' => [
- 'group_featured_video' => [
- 'featured_url' =>[
- 'url' => true,
- 'only_videos' => true,
- ],
- ],
- ],
- ],
- ];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement