lightspeeddevelopment /
to-reviews
| 1 | <?php |
||
| 2 | /** |
||
| 3 | * Tour Operator - Review Metabox config |
||
| 4 | * |
||
| 5 | * @package tour_operator |
||
| 6 | * @author LightSpeed |
||
| 7 | * @license GPL-2.0+ |
||
| 8 | * @link |
||
| 9 | * @copyright 2017 LightSpeedDevelopment |
||
| 10 | */ |
||
| 11 | |||
| 12 | $metabox = array( |
||
| 13 | 'title' => esc_html__( 'Tour Operator Plugin', 'to-reviews' ), |
||
| 14 | 'pages' => 'review', |
||
| 15 | 'fields' => array(), |
||
| 16 | ); |
||
| 17 | |||
| 18 | $metabox['fields'][] = array( |
||
| 19 | 'id' => 'featured', |
||
| 20 | 'name' => esc_html__( 'Featured', 'to-reviews' ), |
||
| 21 | 'type' => 'checkbox', |
||
| 22 | ); |
||
| 23 | |||
| 24 | $metabox['fields'][] = array( |
||
| 25 | 'id' => 'disable_single', |
||
| 26 | 'name' => esc_html__( 'Disable Single', 'to-reviews' ), |
||
| 27 | 'type' => 'checkbox', |
||
| 28 | ); |
||
| 29 | |||
| 30 | if ( ! class_exists( 'LSX_Banners' ) ) { |
||
|
0 ignored issues
–
show
Coding Style
introduced
by
Loading history...
|
|||
| 31 | $metabox['fields'][] = array( |
||
| 32 | 'id' => 'tagline', |
||
| 33 | 'name' => esc_html__( 'Tagline', 'to-reviews' ), |
||
| 34 | 'type' => 'text', |
||
| 35 | ); |
||
| 36 | } |
||
| 37 | |||
| 38 | $metabox['fields'][] = array( |
||
| 39 | 'id' => 'no_adults', |
||
|
0 ignored issues
–
show
|
|||
| 40 | 'name' => esc_html__( 'No of Adults', 'to-reviews' ), |
||
|
0 ignored issues
–
show
|
|||
| 41 | 'type' => 'text', |
||
|
0 ignored issues
–
show
|
|||
| 42 | 'cols' => 6, |
||
|
0 ignored issues
–
show
|
|||
| 43 | ); |
||
| 44 | |||
| 45 | $metabox['fields'][] = array( |
||
| 46 | 'id' => 'no_children', |
||
|
0 ignored issues
–
show
|
|||
| 47 | 'name' => esc_html__( 'No of Children', 'to-reviews' ), |
||
|
0 ignored issues
–
show
|
|||
| 48 | 'type' => 'text', |
||
|
0 ignored issues
–
show
|
|||
| 49 | 'cols' => 6, |
||
|
0 ignored issues
–
show
|
|||
| 50 | ); |
||
| 51 | |||
| 52 | $metabox['fields'][] = array( |
||
| 53 | 'id' => 'reviewer_name', |
||
|
0 ignored issues
–
show
|
|||
| 54 | 'name' => esc_html__( 'Reviewer Name', 'to-reviews' ), |
||
|
0 ignored issues
–
show
|
|||
| 55 | 'type' => 'text', |
||
|
0 ignored issues
–
show
|
|||
| 56 | 'cols' => 6, |
||
|
0 ignored issues
–
show
|
|||
| 57 | ); |
||
| 58 | |||
| 59 | $metabox['fields'][] = array( |
||
| 60 | 'id' => 'reviewer_email', |
||
|
0 ignored issues
–
show
|
|||
| 61 | 'name' => esc_html__( 'Reviewer Email', 'to-reviews' ), |
||
|
0 ignored issues
–
show
|
|||
| 62 | 'type' => 'text', |
||
|
0 ignored issues
–
show
|
|||
| 63 | 'cols' => 6, |
||
|
0 ignored issues
–
show
|
|||
| 64 | ); |
||
| 65 | |||
| 66 | $metabox['fields'][] = array( |
||
| 67 | 'id' => 'rating', |
||
|
0 ignored issues
–
show
|
|||
| 68 | 'name' => esc_html__( 'Rating', 'to-reviews' ), |
||
|
0 ignored issues
–
show
|
|||
| 69 | 'type' => 'radio', |
||
|
0 ignored issues
–
show
|
|||
| 70 | 'options' => array( '0', '1', '2', '3', '4', '5' ), |
||
|
0 ignored issues
–
show
|
|||
| 71 | 'allow_none' => true, |
||
| 72 | ); |
||
| 73 | $metabox['fields'][] = array( |
||
| 74 | 'id' => 'date_of_visit_start', |
||
|
0 ignored issues
–
show
|
|||
| 75 | 'name' => esc_html__( 'Date of visit', 'to-reviews' ), |
||
|
0 ignored issues
–
show
|
|||
| 76 | 'type' => 'date', |
||
|
0 ignored issues
–
show
|
|||
| 77 | 'cols' => 6, |
||
|
0 ignored issues
–
show
|
|||
| 78 | ); |
||
| 79 | |||
| 80 | $metabox['fields'][] = array( |
||
| 81 | 'id' => 'date_of_visit_end', |
||
|
0 ignored issues
–
show
|
|||
| 82 | 'name' => '', |
||
|
0 ignored issues
–
show
|
|||
| 83 | 'type' => 'date', |
||
|
0 ignored issues
–
show
|
|||
| 84 | 'cols' => 6, |
||
|
0 ignored issues
–
show
|
|||
| 85 | ); |
||
| 86 | |||
| 87 | if ( class_exists( 'LSX_TO_Team' ) ) { |
||
|
0 ignored issues
–
show
|
|||
| 88 | $metabox['fields'][] = array( |
||
| 89 | 'id' => 'team_to_review', |
||
| 90 | 'name' => esc_html__( 'Reviewed By', 'to-reviews' ), |
||
| 91 | 'type' => 'post_select', |
||
| 92 | 'use_ajax' => false, |
||
| 93 | 'allow_none' => true, |
||
| 94 | 'query' => array( |
||
| 95 | 'post_type' => 'team', |
||
| 96 | 'nopagin' => true, |
||
| 97 | 'posts_per_page' => 1000, |
||
|
0 ignored issues
–
show
|
|||
| 98 | 'orderby' => 'title', |
||
| 99 | 'order' => 'ASC', |
||
| 100 | ), |
||
| 101 | ); |
||
| 102 | } |
||
| 103 | |||
| 104 | $metabox['fields'][] = array( |
||
| 105 | 'id' => 'gallery_title', |
||
| 106 | 'name' => esc_html__( 'Gallery', 'to-reviews' ), |
||
| 107 | 'type' => 'title', |
||
| 108 | ); |
||
| 109 | |||
| 110 | $metabox['fields'][] = array( |
||
| 111 | 'id' => 'gallery', |
||
| 112 | 'name' => '', |
||
| 113 | 'type' => 'image', |
||
| 114 | 'repeatable' => true, |
||
| 115 | 'show_size' => false, |
||
| 116 | 'sortable' => true, |
||
| 117 | 'string-repeat-field' => esc_html__( 'Add new image', 'tour-operator' ), |
||
| 118 | ); |
||
| 119 | |||
| 120 | if ( class_exists( 'Envira_Gallery' ) ) { |
||
|
0 ignored issues
–
show
|
|||
| 121 | $metabox['fields'][] = array( |
||
| 122 | 'id' => 'envira_title', |
||
| 123 | 'name' => esc_html__( 'Envira Gallery', 'to-reviews' ), |
||
| 124 | 'type' => 'title', |
||
| 125 | ); |
||
| 126 | |||
| 127 | $metabox['fields'][] = array( |
||
| 128 | 'id' => 'envira_gallery', |
||
| 129 | 'name' => esc_html__( 'Envira Gallery', 'to-reviews' ), |
||
| 130 | 'type' => 'post_select', |
||
| 131 | 'use_ajax' => false, |
||
| 132 | 'allow_none' => true, |
||
| 133 | 'query' => array( |
||
| 134 | 'post_type' => 'envira', |
||
| 135 | 'nopagin' => true, |
||
| 136 | 'posts_per_page' => '-1', |
||
| 137 | 'orderby' => 'title', |
||
| 138 | 'order' => 'ASC', |
||
| 139 | ), |
||
| 140 | ); |
||
| 141 | |||
| 142 | if ( class_exists( 'Envira_Videos' ) ) { |
||
|
0 ignored issues
–
show
|
|||
| 143 | $metabox['fields'][] = array( |
||
| 144 | 'id' => 'envira_video', |
||
| 145 | 'name' => esc_html__( 'Envira Video Gallery', 'to-reviews' ), |
||
| 146 | 'type' => 'post_select', |
||
| 147 | 'use_ajax' => false, |
||
| 148 | 'allow_none' => true, |
||
| 149 | 'query' => array( |
||
| 150 | 'post_type' => 'envira', |
||
| 151 | 'nopagin' => true, |
||
| 152 | 'posts_per_page' => '-1', |
||
| 153 | 'orderby' => 'title', |
||
| 154 | 'order' => 'ASC', |
||
| 155 | ), |
||
| 156 | ); |
||
| 157 | } |
||
| 158 | } |
||
| 159 | |||
| 160 | $post_types = array( |
||
| 161 | 'post' => esc_html__( 'Posts', 'to-reviews' ), |
||
| 162 | 'accommodation' => esc_html__( 'Accommodation', 'to-reviews' ), |
||
| 163 | 'destination' => esc_html__( 'Destinations', 'to-reviews' ), |
||
| 164 | 'tour' => esc_html__( 'Tours', 'to-reviews' ), |
||
| 165 | ); |
||
| 166 | |||
| 167 | foreach ( $post_types as $slug => $label ) { |
||
|
0 ignored issues
–
show
|
|||
| 168 | $metabox['fields'][] = array( |
||
| 169 | 'id' => $slug . '_title', |
||
| 170 | 'name' => $label, |
||
| 171 | 'type' => 'title', |
||
| 172 | ); |
||
| 173 | |||
| 174 | $metabox['fields'][] = array( |
||
| 175 | 'id' => $slug . '_to_review', |
||
| 176 | 'name' => $label . esc_html__( ' related with this review', 'to-reviews' ), |
||
| 177 | 'type' => 'post_select', |
||
| 178 | 'use_ajax' => false, |
||
| 179 | 'repeatable' => true, |
||
| 180 | 'allow_none' => true, |
||
| 181 | 'query' => array( |
||
| 182 | 'post_type' => $slug, |
||
| 183 | 'nopagin' => true, |
||
| 184 | 'posts_per_page' => '-1', |
||
| 185 | 'orderby' => 'title', |
||
| 186 | 'order' => 'ASC', |
||
| 187 | ), |
||
| 188 | ); |
||
| 189 | } |
||
| 190 | |||
| 191 | $metabox['fields'] = apply_filters( 'lsx_to_review_custom_fields', $metabox['fields'] ); |
||
| 192 | |||
| 193 | return $metabox; |
||
| 194 |