ContentTabController.php
3 years ago
SettingsTabController.php
3 years ago
StyleTabController.php
3 years ago
SettingsTabController.php
349 lines
| 1 | <?php |
| 2 | |
| 3 | namespace RT\ThePostGrid\Controllers\Blocks\BlockController; |
| 4 | |
| 5 | use RT\ThePostGrid\Helpers\Fns; |
| 6 | |
| 7 | class SettingsTabController { |
| 8 | |
| 9 | /** |
| 10 | * @return mixed|void |
| 11 | */ |
| 12 | public static function get_controller( $prefix = '' ) { |
| 13 | |
| 14 | $settings_attribute = [ |
| 15 | 'show_section_title' => [ |
| 16 | 'type' => 'string', |
| 17 | 'default' => 'show', |
| 18 | ], |
| 19 | |
| 20 | 'show_title' => [ |
| 21 | 'type' => 'string', |
| 22 | 'default' => 'show', |
| 23 | ], |
| 24 | |
| 25 | 'show_thumb' => [ |
| 26 | 'type' => 'string', |
| 27 | 'default' => 'show', |
| 28 | ], |
| 29 | |
| 30 | 'show_excerpt' => [ |
| 31 | 'type' => 'string', |
| 32 | 'default' => 'show', |
| 33 | ], |
| 34 | |
| 35 | 'show_meta' => [ |
| 36 | 'type' => 'string', |
| 37 | 'default' => 'show', |
| 38 | ], |
| 39 | |
| 40 | 'show_date' => [ |
| 41 | 'type' => 'string', |
| 42 | 'default' => 'show', |
| 43 | ], |
| 44 | |
| 45 | 'show_category' => [ |
| 46 | 'type' => 'string', |
| 47 | 'default' => 'show', |
| 48 | ], |
| 49 | |
| 50 | 'show_author' => [ |
| 51 | 'type' => 'string', |
| 52 | 'default' => 'show', |
| 53 | ], |
| 54 | |
| 55 | 'show_tags' => [ |
| 56 | 'type' => 'string', |
| 57 | 'default' => '', |
| 58 | ], |
| 59 | |
| 60 | 'show_comment_count' => [ |
| 61 | 'type' => 'string', |
| 62 | 'default' => '', |
| 63 | ], |
| 64 | |
| 65 | 'show_post_count' => [ |
| 66 | 'type' => 'string', |
| 67 | 'default' => '', |
| 68 | ], |
| 69 | |
| 70 | 'show_read_more' => [ |
| 71 | 'type' => 'string', |
| 72 | 'default' => 'show', |
| 73 | ], |
| 74 | |
| 75 | 'show_social_share' => [ |
| 76 | 'type' => 'string', |
| 77 | 'default' => '', |
| 78 | ], |
| 79 | |
| 80 | 'show_woocommerce_rating' => [ |
| 81 | 'type' => 'string', |
| 82 | 'default' => '', |
| 83 | ], |
| 84 | |
| 85 | // Section Title Settings |
| 86 | |
| 87 | 'section_title_style' => [ |
| 88 | 'type' => 'string', |
| 89 | 'default' => 'style1', |
| 90 | ], |
| 91 | |
| 92 | 'section_title_source' => [ |
| 93 | 'type' => 'string', |
| 94 | 'default' => 'custom_title', |
| 95 | ], |
| 96 | |
| 97 | 'section_title_text' => [ |
| 98 | 'type' => 'string', |
| 99 | 'default' => 'Section Title', |
| 100 | ], |
| 101 | |
| 102 | 'title_prefix' => [ |
| 103 | 'type' => 'string', |
| 104 | 'default' => '', |
| 105 | ], |
| 106 | |
| 107 | 'title_suffix' => [ |
| 108 | 'type' => 'string', |
| 109 | 'default' => '', |
| 110 | ], |
| 111 | |
| 112 | 'section_title_tag' => [ |
| 113 | 'type' => 'string', |
| 114 | 'default' => 'h2', |
| 115 | ], |
| 116 | |
| 117 | // Title Settings |
| 118 | |
| 119 | 'title_tag' => [ |
| 120 | 'type' => 'string', |
| 121 | 'default' => 'h3', |
| 122 | ], |
| 123 | |
| 124 | 'title_visibility_style' => [ |
| 125 | 'type' => 'string', |
| 126 | 'default' => 'default', |
| 127 | ], |
| 128 | |
| 129 | 'title_limit' => [ |
| 130 | 'type' => 'string', |
| 131 | 'default' => '', |
| 132 | ], |
| 133 | |
| 134 | 'title_limit_type' => [ |
| 135 | 'type' => 'string', |
| 136 | 'default' => 'word', |
| 137 | ], |
| 138 | |
| 139 | 'title_position' => [ |
| 140 | 'type' => 'string', |
| 141 | 'default' => 'default', |
| 142 | ], |
| 143 | |
| 144 | 'title_position_hidden' => [ |
| 145 | 'type' => 'string', |
| 146 | 'default' => 'default', |
| 147 | ], |
| 148 | |
| 149 | 'title_hover_underline' => [ |
| 150 | 'type' => 'string', |
| 151 | 'default' => 'default', |
| 152 | ], |
| 153 | |
| 154 | // Thumbnail Settings |
| 155 | |
| 156 | 'media_source' => [ |
| 157 | 'type' => 'string', |
| 158 | 'default' => 'feature_image', |
| 159 | ], |
| 160 | |
| 161 | 'image_size' => [ |
| 162 | 'type' => 'string', |
| 163 | 'default' => 'medium_large', |
| 164 | ], |
| 165 | |
| 166 | 'image_offset_size' => [ |
| 167 | 'type' => 'string', |
| 168 | 'default' => 'medium_large', |
| 169 | ], |
| 170 | |
| 171 | 'img_crop_style' => [ |
| 172 | 'type' => 'string', |
| 173 | 'default' => 'hard', |
| 174 | ], |
| 175 | |
| 176 | 'image_offset' => [ |
| 177 | 'type' => 'string', |
| 178 | 'default' => 'medium_large', |
| 179 | ], |
| 180 | 'list_image_side_width' => [ |
| 181 | 'type' => 'object', |
| 182 | "default" => (object) [ |
| 183 | 'lg' => '', |
| 184 | 'md' => '', |
| 185 | 'sm' => '', |
| 186 | ], |
| 187 | 'style' => [ |
| 188 | (object) [ |
| 189 | 'selector' => '{{RTTPG}} .rt-tpg-container .list-layout-wrapper [class*="rt-col"]:not(.offset-left) .rt-holder .tpg-el-image-wrap {flex: 0 0 {{list_image_side_width}};max-width:{{list_image_side_width}}; }' |
| 190 | ] |
| 191 | ] |
| 192 | ], |
| 193 | |
| 194 | 'image_height' => [ |
| 195 | 'type' => 'object', |
| 196 | "default" => (object) [ |
| 197 | 'lg' => '', |
| 198 | 'md' => '', |
| 199 | 'sm' => '', |
| 200 | ], |
| 201 | 'style' => [ |
| 202 | (object) [ |
| 203 | 'selector' => '{{RTTPG}} .tpg-el-main-wrapper .rt-content-loader > :not(.offset-right) .tpg-el-image-wrap, |
| 204 | {{RTTPG}} .tpg-el-main-wrapper .rt-content-loader > :not(.offset-right) .tpg-el-image-wrap img, |
| 205 | {{RTTPG}} .tpg-el-main-wrapper.slider-layout11-main .rt-grid-hover-item .rt-holder .rt-el-content-wrapper, |
| 206 | {{RTTPG}} .tpg-el-main-wrapper.slider-layout12-main .rt-grid-hover-item .rt-holder .rt-el-content-wrapper |
| 207 | {height: {{image_height}}; }' |
| 208 | ] |
| 209 | ] |
| 210 | ], |
| 211 | |
| 212 | 'offset_image_height' => [ |
| 213 | 'type' => 'object', |
| 214 | "default" => (object) [ |
| 215 | 'lg' => '', |
| 216 | 'md' => '', |
| 217 | 'sm' => '', |
| 218 | ], |
| 219 | 'style' => [ |
| 220 | (object) [ |
| 221 | 'selector' => '{{RTTPG}} .tpg-el-main-wrapper .rt-content-loader .offset-right .tpg-el-image-wrap, |
| 222 | {{RTTPG}} .tpg-el-main-wrapper .rt-content-loader .offset-right .tpg-el-image-wrap img {height: {{offset_image_height}}; }' |
| 223 | ] |
| 224 | ] |
| 225 | ], |
| 226 | |
| 227 | 'c_image_width' => [ |
| 228 | 'type' => 'string', |
| 229 | 'default' => '', |
| 230 | ], |
| 231 | |
| 232 | 'c_image_height' => [ |
| 233 | 'type' => 'string', |
| 234 | 'default' => '', |
| 235 | ], |
| 236 | |
| 237 | 'hover_animation' => [ |
| 238 | 'type' => 'string', |
| 239 | 'default' => 'default', |
| 240 | ], |
| 241 | |
| 242 | 'is_thumb_lightbox' => [ |
| 243 | 'type' => 'string', |
| 244 | 'default' => 'default', |
| 245 | ], |
| 246 | |
| 247 | 'is_default_img' => [ |
| 248 | 'type' => 'string', |
| 249 | 'default' => '', |
| 250 | ], |
| 251 | |
| 252 | 'default_image' => [ |
| 253 | 'type' => 'object', |
| 254 | 'default' => [], |
| 255 | ], |
| 256 | |
| 257 | // Post Excerpt Settings |
| 258 | |
| 259 | 'excerpt_type' => [ |
| 260 | 'type' => 'string', |
| 261 | 'default' => 'character', |
| 262 | ], |
| 263 | |
| 264 | 'excerpt_limit' => [ |
| 265 | 'type' => 'string', |
| 266 | 'default' => '100', |
| 267 | ], |
| 268 | |
| 269 | 'excerpt_more_text' => [ |
| 270 | 'type' => 'string', |
| 271 | 'default' => '...', |
| 272 | ], |
| 273 | |
| 274 | // Post Meta Settings |
| 275 | |
| 276 | 'meta_position' => [ |
| 277 | 'type' => 'string', |
| 278 | 'default' => 'default', |
| 279 | ], |
| 280 | |
| 281 | 'show_meta_icon' => [ |
| 282 | 'type' => 'string', |
| 283 | 'default' => 'yes', |
| 284 | ], |
| 285 | |
| 286 | 'meta_separator' => [ |
| 287 | 'type' => 'string', |
| 288 | 'default' => 'default', |
| 289 | ], |
| 290 | |
| 291 | 'meta_ordering' => [ |
| 292 | 'type' => 'array', |
| 293 | 'default' => [], |
| 294 | ], |
| 295 | |
| 296 | // user meta |
| 297 | 'author_prefix' => [ |
| 298 | 'type' => 'string', |
| 299 | 'default' => '', |
| 300 | ], |
| 301 | 'author_icon_visibility' => [ |
| 302 | 'type' => 'string', |
| 303 | 'default' => 'default', |
| 304 | ], |
| 305 | 'show_author_image' => [ |
| 306 | 'type' => 'string', |
| 307 | 'default' => 'image', |
| 308 | ], |
| 309 | |
| 310 | |
| 311 | //ACF Settings given below |
| 312 | |
| 313 | 'acf_data_lists' => [ |
| 314 | 'type' => 'object', |
| 315 | 'default' => [], |
| 316 | ], |
| 317 | |
| 318 | // Read More Settings |
| 319 | |
| 320 | |
| 321 | 'readmore_btn_style' => [ |
| 322 | 'type' => 'string', |
| 323 | 'default' => 'default-style', |
| 324 | ], |
| 325 | |
| 326 | 'read_more_label' => [ |
| 327 | 'type' => 'string', |
| 328 | 'default' => 'Read More', |
| 329 | ], |
| 330 | |
| 331 | 'show_btn_icon' => [ |
| 332 | 'type' => 'string', |
| 333 | 'default' => '', |
| 334 | ], |
| 335 | |
| 336 | 'readmore_style_tabs' => [ |
| 337 | 'type' => 'string', |
| 338 | 'default' => 'normal', |
| 339 | ], |
| 340 | |
| 341 | 'readmore_btn_icon' => [ |
| 342 | 'type' => 'string', |
| 343 | 'default' => 'fas fa-angle-right', |
| 344 | ], |
| 345 | ]; |
| 346 | |
| 347 | return apply_filters( 'rttpg_guten_settings_attribute', $settings_attribute ); |
| 348 | } |
| 349 | } |