theme-elements
6 months ago
accordion.php
6 months ago
audio.php
6 months ago
before-after.php
6 months ago
button.php
6 months ago
carousel-navigation.php
6 months ago
circle-chart.php
6 months ago
contact-box.php
6 months ago
contact-form.php
6 months ago
custom-list.php
6 months ago
divider.php
6 months ago
gallery.php
6 months ago
gmap.php
1 week ago
heading-modern.php
5 months ago
icon.php
6 months ago
image.php
6 months ago
mailchimp.php
6 months ago
modern-button.php
6 months ago
products-grid.php
6 months ago
quote.php
6 months ago
recent-comments.php
6 months ago
recent-posts-grid-carousel.php
2 months ago
recent-posts-land-style.php
6 months ago
recent-posts-masonry.php
6 months ago
recent-posts-tiles-carousel.php
6 months ago
recent-posts-tiles.php
6 months ago
recent-posts-timeline.php
6 months ago
recent-products.php
6 months ago
responsive-table.php
6 months ago
search.php
6 months ago
staff.php
6 months ago
svg.php
6 months ago
tabs.php
6 months ago
testimonial.php
6 months ago
text.php
6 months ago
touch-slider.php
6 months ago
video.php
6 months ago
recent-posts-land-style.php
1055 lines
| 1 | <?php |
| 2 | namespace Auxin\Plugin\CoreElements\Elementor\Elements; |
| 3 | |
| 4 | use Elementor\Plugin; |
| 5 | use Elementor\Widget_Base; |
| 6 | use Elementor\Controls_Manager; |
| 7 | use Elementor\Group_Control_Typography; |
| 8 | use Elementor\Core\Kits\Documents\Tabs\Global_Typography; |
| 9 | use Elementor\Group_Control_Box_Shadow; |
| 10 | |
| 11 | if ( ! defined( 'ABSPATH' ) ) { |
| 12 | exit; // Exit if accessed directly. |
| 13 | } |
| 14 | |
| 15 | /** |
| 16 | * Elementor 'RecentPostsLand' widget. |
| 17 | * |
| 18 | * Elementor widget that displays an 'RecentPostsLand' with lightbox. |
| 19 | * |
| 20 | * @since 1.0.0 |
| 21 | */ |
| 22 | class RecentPostsLand extends Widget_Base { |
| 23 | |
| 24 | /** |
| 25 | * Get widget name. |
| 26 | * |
| 27 | * Retrieve 'RecentPostsLand' widget name. |
| 28 | * |
| 29 | * @since 1.0.0 |
| 30 | * @access public |
| 31 | * |
| 32 | * @return string Widget name. |
| 33 | */ |
| 34 | public function get_name() { |
| 35 | return 'aux_recent_posts_land_style'; |
| 36 | } |
| 37 | |
| 38 | /** |
| 39 | * Get widget title. |
| 40 | * |
| 41 | * Retrieve 'RecentPostsLand' widget title. |
| 42 | * |
| 43 | * @since 1.0.0 |
| 44 | * @access public |
| 45 | * |
| 46 | * @return string Widget title. |
| 47 | */ |
| 48 | public function get_title() { |
| 49 | return __('Land Style Posts', 'auxin-elements' ); |
| 50 | } |
| 51 | |
| 52 | public function has_widget_inner_wrapper(): bool { |
| 53 | return ! \Elementor\Plugin::$instance->experiments->is_feature_active( 'e_optimized_markup' ); |
| 54 | } |
| 55 | |
| 56 | |
| 57 | /** |
| 58 | * Get widget icon. |
| 59 | * |
| 60 | * Retrieve 'RecentPostsLand' widget icon. |
| 61 | * |
| 62 | * @since 1.0.0 |
| 63 | * @access public |
| 64 | * |
| 65 | * @return string Widget icon. |
| 66 | */ |
| 67 | public function get_icon() { |
| 68 | return 'eicon-post-list auxin-badge'; |
| 69 | } |
| 70 | |
| 71 | /** |
| 72 | * Get widget categories. |
| 73 | * |
| 74 | * Retrieve 'RecentPostsLand' widget icon. |
| 75 | * |
| 76 | * @since 1.0.0 |
| 77 | * @access public |
| 78 | * |
| 79 | * @return string Widget icon. |
| 80 | */ |
| 81 | public function get_categories() { |
| 82 | return array( 'auxin-dynamic' ); |
| 83 | } |
| 84 | |
| 85 | /** |
| 86 | * Retrieve the terms in a given taxonomy or list of taxonomies. |
| 87 | * |
| 88 | * Retrieve 'RecentPostsLand' widget icon. |
| 89 | * |
| 90 | * @since 1.0.0 |
| 91 | * @access public |
| 92 | * |
| 93 | * @return string Widget icon. |
| 94 | */ |
| 95 | public function get_terms() { |
| 96 | $terms = get_terms([ |
| 97 | 'taxonomy' => 'category', |
| 98 | 'orderby' => 'count', |
| 99 | 'hide_empty' => false |
| 100 | ]); |
| 101 | |
| 102 | $list = array( ' ' => __('All Categories', 'auxin-elements' ) ) ; |
| 103 | foreach ( $terms as $key => $value ) { |
| 104 | $list[$value->term_id] = $value->name; |
| 105 | } |
| 106 | |
| 107 | return $list; |
| 108 | } |
| 109 | |
| 110 | /** |
| 111 | * Register 'RecentPostsLand' widget controls. |
| 112 | * |
| 113 | * Adds different input fields to allow the user to change and customize the widget settings. |
| 114 | * |
| 115 | * @since 1.0.0 |
| 116 | * @access protected |
| 117 | */ |
| 118 | protected function register_controls() { |
| 119 | |
| 120 | /*-----------------------------------------------------------------------------------*/ |
| 121 | /* layout_section |
| 122 | /*-----------------------------------------------------------------------------------*/ |
| 123 | |
| 124 | $this->start_controls_section( |
| 125 | 'display_section', |
| 126 | array( |
| 127 | 'label' => __('Display', 'auxin-elements' ), |
| 128 | 'tab' => Controls_Manager::TAB_LAYOUT |
| 129 | ) |
| 130 | ); |
| 131 | |
| 132 | $this->add_control( |
| 133 | 'show_media', |
| 134 | array( |
| 135 | 'label' => __('Display post media (image, video, etc)','auxin-elements' ), |
| 136 | 'label_block' => true, |
| 137 | 'type' => Controls_Manager::SWITCHER, |
| 138 | 'label_on' => __( 'On', 'auxin-elements' ), |
| 139 | 'label_off' => __( 'Off', 'auxin-elements' ), |
| 140 | 'return_value' => 'yes', |
| 141 | 'default' => 'yes' |
| 142 | ) |
| 143 | ); |
| 144 | |
| 145 | $this->add_control( |
| 146 | 'preloadable', |
| 147 | array( |
| 148 | 'label' => __('Preload image','auxin-elements' ), |
| 149 | 'type' => Controls_Manager::SWITCHER, |
| 150 | 'label_on' => __( 'On', 'auxin-elements' ), |
| 151 | 'label_off' => __( 'Off', 'auxin-elements' ), |
| 152 | 'return_value' => 'yes', |
| 153 | 'default' => 'no', |
| 154 | 'condition' => array( |
| 155 | 'show_media' => 'yes', |
| 156 | ) |
| 157 | ) |
| 158 | ); |
| 159 | |
| 160 | $this->add_control( |
| 161 | 'preload_preview', |
| 162 | array( |
| 163 | 'label' => __('While loading image display','auxin-elements' ), |
| 164 | 'label_block' => true, |
| 165 | 'type' => Controls_Manager::SELECT, |
| 166 | 'options' => auxin_get_preloadable_previews(), |
| 167 | 'return_value' => 'yes', |
| 168 | 'default' => 'yes', |
| 169 | 'condition' => array( |
| 170 | 'preloadable' => 'yes' |
| 171 | ) |
| 172 | ) |
| 173 | ); |
| 174 | |
| 175 | $this->add_control( |
| 176 | 'preload_bgcolor', |
| 177 | array( |
| 178 | 'label' => __( 'Placeholder color while loading image', 'auxin-elements' ), |
| 179 | 'type' => Controls_Manager::COLOR, |
| 180 | 'condition' => array( |
| 181 | 'preloadable' => 'yes', |
| 182 | 'preload_preview' => array('simple-spinner', 'simple-spinner-light', 'simple-spinner-dark') |
| 183 | ) |
| 184 | ) |
| 185 | ); |
| 186 | |
| 187 | $this->add_control( |
| 188 | 'display_title', |
| 189 | array( |
| 190 | 'label' => __('Display post title', 'auxin-elements' ), |
| 191 | 'type' => Controls_Manager::SWITCHER, |
| 192 | 'label_on' => __( 'On', 'auxin-elements' ), |
| 193 | 'label_off' => __( 'Off', 'auxin-elements' ), |
| 194 | 'return_value' => 'yes', |
| 195 | 'default' => 'yes' |
| 196 | ) |
| 197 | ); |
| 198 | |
| 199 | $this->add_control( |
| 200 | 'show_info', |
| 201 | array( |
| 202 | 'label' => __('Display post info', 'auxin-elements' ), |
| 203 | 'type' => Controls_Manager::SWITCHER, |
| 204 | 'label_on' => __( 'On', 'auxin-elements' ), |
| 205 | 'label_off' => __( 'Off', 'auxin-elements' ), |
| 206 | 'return_value' => 'yes', |
| 207 | 'default' => 'yes' |
| 208 | ) |
| 209 | ); |
| 210 | |
| 211 | $this->add_control( |
| 212 | 'display_author_header', |
| 213 | array( |
| 214 | 'label' => __('Display Author in Header','auxin-elements' ), |
| 215 | 'description' => __('Enable it to display author name in header','auxin-elements' ), |
| 216 | 'type' => Controls_Manager::SWITCHER, |
| 217 | 'label_on' => __( 'On', 'auxin-elements' ), |
| 218 | 'label_off' => __( 'Off', 'auxin-elements' ), |
| 219 | 'return_value' => 'yes', |
| 220 | 'default' => 'yes', |
| 221 | 'condition' => array( |
| 222 | 'show_info' => 'yes', |
| 223 | ) |
| 224 | ) |
| 225 | ); |
| 226 | |
| 227 | $this->add_control( |
| 228 | 'display_categories', |
| 229 | array( |
| 230 | 'label' => __('Display Categories','auxin-elements' ), |
| 231 | 'type' => Controls_Manager::SWITCHER, |
| 232 | 'label_on' => __( 'On', 'auxin-elements' ), |
| 233 | 'label_off' => __( 'Off', 'auxin-elements' ), |
| 234 | 'return_value' => 'yes', |
| 235 | 'default' => 'yes', |
| 236 | 'condition' => array( |
| 237 | 'show_info' => 'yes', |
| 238 | ) |
| 239 | ) |
| 240 | ); |
| 241 | |
| 242 | $this->add_control( |
| 243 | 'max_taxonomy_num', |
| 244 | array( |
| 245 | |
| 246 | 'label' => __('Number of Categories Limit','auxin-elements' ), |
| 247 | 'type' => Controls_Manager::NUMBER, |
| 248 | 'default' => '1', |
| 249 | 'condition' => array( |
| 250 | 'show_info' => 'yes', |
| 251 | 'display_categories' => 'yes' |
| 252 | ) |
| 253 | ) |
| 254 | ); |
| 255 | |
| 256 | $this->add_control( |
| 257 | 'show_date', |
| 258 | array( |
| 259 | 'label' => __('Display Date','auxin-elements' ), |
| 260 | 'type' => Controls_Manager::SWITCHER, |
| 261 | 'label_on' => __( 'On', 'auxin-elements' ), |
| 262 | 'label_off' => __( 'Off', 'auxin-elements' ), |
| 263 | 'return_value' => 'yes', |
| 264 | 'default' => 'yes', |
| 265 | 'condition' => array( |
| 266 | 'show_info' => 'yes', |
| 267 | ) |
| 268 | ) |
| 269 | ); |
| 270 | |
| 271 | $this->add_control( |
| 272 | 'display_comments', |
| 273 | array( |
| 274 | 'label' => __('Display Comments Number', 'auxin-elements' ), |
| 275 | 'type' => Controls_Manager::SWITCHER, |
| 276 | 'label_on' => __( 'On', 'auxin-elements' ), |
| 277 | 'label_off' => __( 'Off', 'auxin-elements' ), |
| 278 | 'return_value' => 'yes', |
| 279 | 'default' => 'yes' |
| 280 | ) |
| 281 | ); |
| 282 | |
| 283 | $this->add_control( |
| 284 | 'display_like', |
| 285 | array( |
| 286 | 'label' => __('Display like button', 'auxin-elements' ), |
| 287 | 'type' => Controls_Manager::SWITCHER, |
| 288 | 'label_on' => __( 'On', 'auxin-elements' ), |
| 289 | 'label_off' => __( 'Off', 'auxin-elements' ), |
| 290 | 'return_value' => 'yes', |
| 291 | 'default' => 'yes' |
| 292 | ) |
| 293 | ); |
| 294 | |
| 295 | $this->add_control( |
| 296 | 'show_excerpt', |
| 297 | array( |
| 298 | 'label' => __('Display excerpt','auxin-elements' ), |
| 299 | 'description' => __('Enable it to display post summary instead of full content.','auxin-elements' ), |
| 300 | 'type' => Controls_Manager::SWITCHER, |
| 301 | 'label_on' => __( 'On', 'auxin-elements' ), |
| 302 | 'label_off' => __( 'Off', 'auxin-elements' ), |
| 303 | 'return_value' => 'yes', |
| 304 | 'default' => 'yes' |
| 305 | ) |
| 306 | ); |
| 307 | |
| 308 | $this->add_control( |
| 309 | 'excerpt_len', |
| 310 | array( |
| 311 | 'label' => __('Content length','auxin-elements' ), |
| 312 | 'description' => __('Shorten the content by characters for the posts with no excerpt','auxin-elements' ), |
| 313 | 'type' => Controls_Manager::NUMBER, |
| 314 | 'default' => '160', |
| 315 | 'condition' => array( |
| 316 | 'show_excerpt' => 'yes', |
| 317 | ) |
| 318 | ) |
| 319 | ); |
| 320 | |
| 321 | $this->add_control( |
| 322 | 'excerpt_length', |
| 323 | array( |
| 324 | 'label' => __('Excerpt length','auxin-elements' ), |
| 325 | 'description' => __('Shorten the excerpt itself','auxin-elements' ), |
| 326 | 'type' => Controls_Manager::NUMBER, |
| 327 | 'default' => '', |
| 328 | 'condition' => array( |
| 329 | 'show_excerpt' => 'yes', |
| 330 | ) |
| 331 | ) |
| 332 | ); |
| 333 | |
| 334 | $this->add_control( |
| 335 | 'author_or_readmore', |
| 336 | array( |
| 337 | 'label' => __('Display author or read more', 'auxin-elements'), |
| 338 | 'label_block' => true, |
| 339 | 'description' => __('Specifies whether to show author or read more on each post.', 'auxin-elements'), |
| 340 | 'type' => Controls_Manager::SELECT, |
| 341 | 'default' => 'readmore', |
| 342 | 'options' => array( |
| 343 | 'readmore' => __('Read More', 'auxin-elements'), |
| 344 | 'author' => __('Author Name', 'auxin-elements'), |
| 345 | 'none' => __('None', 'auxin-elements'), |
| 346 | ) |
| 347 | ) |
| 348 | ); |
| 349 | |
| 350 | $this->add_control( |
| 351 | 'display_author_footer', |
| 352 | array( |
| 353 | 'label' => __('Display Author in Footer','auxin-elements' ), |
| 354 | 'description' => __('Enable it to display author name in footer','auxin-elements' ), |
| 355 | 'type' => Controls_Manager::SWITCHER, |
| 356 | 'label_on' => __( 'On', 'auxin-elements' ), |
| 357 | 'label_off' => __( 'Off', 'auxin-elements' ), |
| 358 | 'return_value' => 'yes', |
| 359 | 'default' => 'no', |
| 360 | 'condition' => array( |
| 361 | 'author_or_readmore' => 'author', |
| 362 | ) |
| 363 | ) |
| 364 | ); |
| 365 | |
| 366 | $this->end_controls_section(); |
| 367 | |
| 368 | /*-----------------------------------------------------------------------------------*/ |
| 369 | /* query_section |
| 370 | /*-----------------------------------------------------------------------------------*/ |
| 371 | |
| 372 | $this->start_controls_section( |
| 373 | 'query_section', |
| 374 | array( |
| 375 | 'label' => __('Query', 'auxin-elements' ), |
| 376 | ) |
| 377 | ); |
| 378 | |
| 379 | $this->add_control( |
| 380 | 'cat', |
| 381 | array( |
| 382 | 'label' => __('Categories', 'auxin-elements'), |
| 383 | 'description' => __('Specifies a category that you want to show posts from it.', 'auxin-elements' ), |
| 384 | 'type' => Controls_Manager::SELECT2, |
| 385 | 'multiple' => true, |
| 386 | 'options' => $this->get_terms(), |
| 387 | 'default' => array( ' ' ), |
| 388 | ) |
| 389 | ); |
| 390 | |
| 391 | $this->add_control( |
| 392 | 'num', |
| 393 | array( |
| 394 | 'label' => __('Number of posts to show', 'auxin-elements'), |
| 395 | 'label_block' => true, |
| 396 | 'type' => Controls_Manager::NUMBER, |
| 397 | 'default' => '8', |
| 398 | 'min' => 1, |
| 399 | 'step' => 1 |
| 400 | ) |
| 401 | ); |
| 402 | |
| 403 | $this->add_control( |
| 404 | 'exclude_without_media', |
| 405 | array( |
| 406 | 'label' => __('Exclude posts without media','auxin-elements' ), |
| 407 | 'type' => Controls_Manager::SWITCHER, |
| 408 | 'label_on' => __( 'On', 'auxin-elements' ), |
| 409 | 'label_off' => __( 'Off', 'auxin-elements' ), |
| 410 | 'return_value' => 'yes', |
| 411 | 'default' => 'no' |
| 412 | ) |
| 413 | ); |
| 414 | |
| 415 | $this->add_control( |
| 416 | 'exclude_custom_post_formats', |
| 417 | array( |
| 418 | 'label' => __('Exclude custom post formats','auxin-elements' ), |
| 419 | 'type' => Controls_Manager::SWITCHER, |
| 420 | 'label_on' => __( 'On', 'auxin-elements' ), |
| 421 | 'label_off' => __( 'Off', 'auxin-elements' ), |
| 422 | 'return_value' => 'yes', |
| 423 | 'default' => 'no', |
| 424 | ) |
| 425 | ); |
| 426 | |
| 427 | $this->add_control( |
| 428 | 'exclude_quote_link', |
| 429 | array( |
| 430 | 'label' => __('Exclude quote and link post formats','auxin-elements' ), |
| 431 | 'type' => Controls_Manager::SWITCHER, |
| 432 | 'label_on' => __( 'On', 'auxin-elements' ), |
| 433 | 'label_off' => __( 'Off', 'auxin-elements' ), |
| 434 | 'return_value' => 'yes', |
| 435 | 'default' => 'no', |
| 436 | 'condition' => array( |
| 437 | 'exclude_custom_post_formats' => 'yes', |
| 438 | ) |
| 439 | ) |
| 440 | ); |
| 441 | |
| 442 | $this->add_control( |
| 443 | 'order_by', |
| 444 | array( |
| 445 | 'label' => __('Order by', 'auxin-elements'), |
| 446 | 'type' => Controls_Manager::SELECT, |
| 447 | 'default' => 'date', |
| 448 | 'options' => array( |
| 449 | 'date' => __('Date', 'auxin-elements'), |
| 450 | 'menu_order date' => __('Menu Order', 'auxin-elements'), |
| 451 | 'title' => __('Title', 'auxin-elements'), |
| 452 | 'ID' => __('ID', 'auxin-elements'), |
| 453 | 'rand' => __('Random', 'auxin-elements'), |
| 454 | 'comment_count' => __('Comments', 'auxin-elements'), |
| 455 | 'modified' => __('Date Modified', 'auxin-elements'), |
| 456 | 'author' => __('Author', 'auxin-elements'), |
| 457 | 'post__in' => __('Inserted Post IDs', 'auxin-elements') |
| 458 | ), |
| 459 | ) |
| 460 | ); |
| 461 | |
| 462 | $this->add_control( |
| 463 | 'order', |
| 464 | array( |
| 465 | 'label' => __('Order', 'auxin-elements'), |
| 466 | 'type' => Controls_Manager::SELECT, |
| 467 | 'default' => 'DESC', |
| 468 | 'options' => array( |
| 469 | 'DESC' => __('Descending', 'auxin-elements'), |
| 470 | 'ASC' => __('Ascending', 'auxin-elements'), |
| 471 | ), |
| 472 | ) |
| 473 | ); |
| 474 | |
| 475 | $this->add_control( |
| 476 | 'only_posts__in', |
| 477 | array( |
| 478 | 'label' => __('Only posts','auxin-elements' ), |
| 479 | 'description' => __('If you intend to display ONLY specific posts, you should specify the posts here. You have to insert the post IDs that are separated by comma (eg. 53,34,87,25).', 'auxin-elements' ), |
| 480 | 'type' => Controls_Manager::TEXT |
| 481 | ) |
| 482 | ); |
| 483 | |
| 484 | $this->add_control( |
| 485 | 'include', |
| 486 | array( |
| 487 | 'label' => __('Include posts','auxin-elements' ), |
| 488 | 'description' => __('If you intend to include additional posts, you should specify the posts here. You have to insert the Post IDs that are separated by comma (eg. 53,34,87,25)', 'auxin-elements' ), |
| 489 | 'type' => Controls_Manager::TEXT |
| 490 | ) |
| 491 | ); |
| 492 | |
| 493 | $this->add_control( |
| 494 | 'exclude', |
| 495 | array( |
| 496 | 'label' => __('Exclude posts','auxin-elements' ), |
| 497 | 'description' => __('If you intend to exclude specific posts from result, you should specify the posts here. You have to insert the Post IDs that are separated by comma (eg. 53,34,87,25)', 'auxin-elements' ), |
| 498 | 'type' => Controls_Manager::TEXT |
| 499 | ) |
| 500 | ); |
| 501 | |
| 502 | $this->add_control( |
| 503 | 'offset', |
| 504 | array( |
| 505 | 'label' => __('Start offset','auxin-elements' ), |
| 506 | 'description' => __('Number of post to displace or pass over.', 'auxin-elements' ), |
| 507 | 'type' => Controls_Manager::NUMBER |
| 508 | ) |
| 509 | ); |
| 510 | |
| 511 | $this->end_controls_section(); |
| 512 | |
| 513 | /*-----------------------------------------------------------------------------------*/ |
| 514 | /* paginate_section |
| 515 | /*-----------------------------------------------------------------------------------*/ |
| 516 | |
| 517 | $this->start_controls_section( |
| 518 | 'paginate_section', |
| 519 | array( |
| 520 | 'label' => __('Paginate', 'auxin-elements' ) |
| 521 | ) |
| 522 | ); |
| 523 | |
| 524 | $this->add_control( |
| 525 | 'loadmore_type', |
| 526 | array( |
| 527 | 'label' => __('Load More Type','auxin-elements' ), |
| 528 | 'type' => 'aux-visual-select', |
| 529 | 'options' => array( |
| 530 | '' => array( |
| 531 | 'label' => __('None', 'auxin-elements' ), |
| 532 | 'image' => AUXIN_URL . 'images/visual-select/load-more-none.svg' |
| 533 | ), |
| 534 | 'scroll' => array( |
| 535 | 'label' => __('Infinite Scroll', 'auxin-elements' ), |
| 536 | 'image' => AUXIN_URL . 'images/visual-select/load-more-infinite.svg' |
| 537 | ), |
| 538 | 'next' => array( |
| 539 | 'label' => __('Next Button', 'auxin-elements' ), |
| 540 | 'image' => AUXIN_URL . 'images/visual-select/load-more-button.svg' |
| 541 | ), |
| 542 | 'next-prev' => array( |
| 543 | 'label' => __('Next Prev', 'auxin-elements' ), |
| 544 | 'image' => AUXIN_URL . 'images/visual-select/load-more-next-prev.svg' |
| 545 | ) |
| 546 | ), |
| 547 | 'default' => '' |
| 548 | ) |
| 549 | ); |
| 550 | |
| 551 | $this->end_controls_section(); |
| 552 | |
| 553 | /*-----------------------------------------------------------------------------------*/ |
| 554 | /* image_style_section |
| 555 | /*-----------------------------------------------------------------------------------*/ |
| 556 | |
| 557 | $this->start_controls_section( |
| 558 | 'image_style_section', |
| 559 | array( |
| 560 | 'label' => __( 'Image', 'auxin-elements' ), |
| 561 | 'tab' => Controls_Manager::TAB_STYLE, |
| 562 | 'condition' => array( |
| 563 | 'show_media' => 'yes' |
| 564 | ) |
| 565 | ) |
| 566 | ); |
| 567 | |
| 568 | $this->add_control( |
| 569 | 'image_aspect_ratio', |
| 570 | array( |
| 571 | 'label' => __('Image aspect ratio', 'auxin-elements'), |
| 572 | 'type' => Controls_Manager::SELECT, |
| 573 | 'default' => '0.75', |
| 574 | 'options' => array( |
| 575 | '0.75' => __('Horizontal 4:3' , 'auxin-elements'), |
| 576 | '0.56' => __('Horizontal 16:9', 'auxin-elements'), |
| 577 | '1.00' => __('Square 1:1' , 'auxin-elements'), |
| 578 | '1.33' => __('Vertical 3:4' , 'auxin-elements') |
| 579 | ), |
| 580 | 'condition' => array( |
| 581 | 'show_media' => 'yes' |
| 582 | ) |
| 583 | ) |
| 584 | ); |
| 585 | |
| 586 | $this->add_control( |
| 587 | 'img_border_radius', |
| 588 | array( |
| 589 | 'label' => __( 'Border Radius', 'auxin-elements' ), |
| 590 | 'type' => Controls_Manager::DIMENSIONS, |
| 591 | 'size_units' => array( 'px', '%' ), |
| 592 | 'selectors' => array( |
| 593 | '{{WRAPPER}} .entry-media img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;', |
| 594 | ), |
| 595 | 'condition' => array( |
| 596 | 'show_media' => 'yes' |
| 597 | ) |
| 598 | ) |
| 599 | ); |
| 600 | |
| 601 | $this->add_group_control( |
| 602 | Group_Control_Box_Shadow::get_type(), |
| 603 | array( |
| 604 | 'name' => 'img_boxshadow_normal', |
| 605 | 'label' => __( 'Box Shadow', 'auxin-elements' ), |
| 606 | 'selector' => '{{WRAPPER}} .aux-media-frame', |
| 607 | 'condition' => array( |
| 608 | 'show_media' => 'yes' |
| 609 | ) |
| 610 | ) |
| 611 | ); |
| 612 | |
| 613 | $this->end_controls_section(); |
| 614 | |
| 615 | /*-----------------------------------------------------------------------------------*/ |
| 616 | /* title_style_section |
| 617 | /*-----------------------------------------------------------------------------------*/ |
| 618 | |
| 619 | $this->start_controls_section( |
| 620 | 'title_style_section', |
| 621 | array( |
| 622 | 'label' => __( 'Title', 'auxin-elements' ), |
| 623 | 'tab' => Controls_Manager::TAB_STYLE, |
| 624 | 'condition' => array( |
| 625 | 'display_title' => 'yes', |
| 626 | ), |
| 627 | ) |
| 628 | ); |
| 629 | |
| 630 | $this->start_controls_tabs( 'title_colors' ); |
| 631 | |
| 632 | $this->start_controls_tab( |
| 633 | 'title_color_normal', |
| 634 | array( |
| 635 | 'label' => __( 'Normal' , 'auxin-elements' ), |
| 636 | 'condition' => array( |
| 637 | 'display_title' => 'yes', |
| 638 | ), |
| 639 | ) |
| 640 | ); |
| 641 | |
| 642 | $this->add_control( |
| 643 | 'title_color', |
| 644 | array( |
| 645 | 'label' => __( 'Color', 'auxin-elements' ), |
| 646 | 'type' => Controls_Manager::COLOR, |
| 647 | 'selectors' => array( |
| 648 | '{{WRAPPER}} .entry-title a' => 'color: {{VALUE}};', |
| 649 | ), |
| 650 | 'condition' => array( |
| 651 | 'display_title' => 'yes', |
| 652 | ), |
| 653 | ) |
| 654 | ); |
| 655 | |
| 656 | $this->end_controls_tab(); |
| 657 | |
| 658 | $this->start_controls_tab( |
| 659 | 'title_color_hover', |
| 660 | array( |
| 661 | 'label' => __( 'Hover' , 'auxin-elements' ), |
| 662 | 'condition' => array( |
| 663 | 'display_title' => 'yes', |
| 664 | ), |
| 665 | ) |
| 666 | ); |
| 667 | |
| 668 | $this->add_control( |
| 669 | 'title_hover_color', |
| 670 | array( |
| 671 | 'label' => __( 'Color', 'auxin-elements' ), |
| 672 | 'type' => Controls_Manager::COLOR, |
| 673 | 'selectors' => array( |
| 674 | '{{WRAPPER}} .entry-title a:hover' => 'color: {{VALUE}};', |
| 675 | ), |
| 676 | 'condition' => array( |
| 677 | 'display_title' => 'yes', |
| 678 | ), |
| 679 | ) |
| 680 | ); |
| 681 | |
| 682 | $this->end_controls_tab(); |
| 683 | |
| 684 | $this->end_controls_tabs(); |
| 685 | |
| 686 | $this->add_group_control( |
| 687 | Group_Control_Typography::get_type(), |
| 688 | array( |
| 689 | 'name' => 'title_typography', |
| 690 | 'global' => [ |
| 691 | 'default' => Global_Typography::TYPOGRAPHY_PRIMARY, |
| 692 | ], |
| 693 | 'selector' => '{{WRAPPER}} .entry-title', |
| 694 | 'condition' => array( |
| 695 | 'display_title' => 'yes', |
| 696 | ), |
| 697 | ) |
| 698 | ); |
| 699 | |
| 700 | $this->add_responsive_control( |
| 701 | 'title_margin_bottom', |
| 702 | array( |
| 703 | 'label' => __( 'Bottom space', 'auxin-elements' ), |
| 704 | 'type' => Controls_Manager::SLIDER, |
| 705 | 'range' => array( |
| 706 | 'px' => array( |
| 707 | 'max' => 100, |
| 708 | ), |
| 709 | ), |
| 710 | 'selectors' => array( |
| 711 | '{{WRAPPER}} .entry-title' => 'margin-bottom: {{SIZE}}{{UNIT}};', |
| 712 | ), |
| 713 | 'condition' => array( |
| 714 | 'display_title' => 'yes', |
| 715 | ), |
| 716 | ) |
| 717 | ); |
| 718 | |
| 719 | $this->end_controls_section(); |
| 720 | |
| 721 | /*-----------------------------------------------------------------------------------*/ |
| 722 | /* info_style_section |
| 723 | /*-----------------------------------------------------------------------------------*/ |
| 724 | |
| 725 | $this->start_controls_section( |
| 726 | 'info_style_section', |
| 727 | array( |
| 728 | 'label' => __( 'Post Info', 'auxin-elements' ), |
| 729 | 'tab' => Controls_Manager::TAB_STYLE, |
| 730 | 'condition' => array( |
| 731 | 'show_info' => 'yes', |
| 732 | ), |
| 733 | ) |
| 734 | ); |
| 735 | |
| 736 | $this->start_controls_tabs( 'info_colors' ); |
| 737 | |
| 738 | $this->start_controls_tab( |
| 739 | 'info_color_normal', |
| 740 | array( |
| 741 | 'label' => __( 'Normal' , 'auxin-elements' ), |
| 742 | 'condition' => array( |
| 743 | 'show_info' => 'yes', |
| 744 | ), |
| 745 | ) |
| 746 | ); |
| 747 | |
| 748 | $this->add_control( |
| 749 | 'info_color', |
| 750 | array( |
| 751 | 'label' => __( 'Color', 'auxin-elements' ), |
| 752 | 'type' => Controls_Manager::COLOR, |
| 753 | 'selectors' => array( |
| 754 | '{{WRAPPER}} .entry-info a, {{WRAPPER}} .entry-info' => 'color: {{VALUE}};', |
| 755 | ), |
| 756 | 'condition' => array( |
| 757 | 'show_info' => 'yes', |
| 758 | ), |
| 759 | ) |
| 760 | ); |
| 761 | |
| 762 | $this->end_controls_tab(); |
| 763 | |
| 764 | $this->start_controls_tab( |
| 765 | 'info_color_hover', |
| 766 | array( |
| 767 | 'label' => __( 'Hover' , 'auxin-elements' ), |
| 768 | 'condition' => array( |
| 769 | 'show_info' => 'yes', |
| 770 | ), |
| 771 | ) |
| 772 | ); |
| 773 | |
| 774 | $this->add_control( |
| 775 | 'info_hover_color', |
| 776 | array( |
| 777 | 'label' => __( 'Color', 'auxin-elements' ), |
| 778 | 'type' => Controls_Manager::COLOR, |
| 779 | 'selectors' => array( |
| 780 | '{{WRAPPER}} .entry-info a:hover' => 'color: {{VALUE}};', |
| 781 | ), |
| 782 | 'condition' => array( |
| 783 | 'show_info' => 'yes', |
| 784 | ), |
| 785 | ) |
| 786 | ); |
| 787 | |
| 788 | $this->end_controls_tab(); |
| 789 | |
| 790 | $this->end_controls_tabs(); |
| 791 | |
| 792 | $this->add_group_control( |
| 793 | Group_Control_Typography::get_type(), |
| 794 | array( |
| 795 | 'name' => 'info_typography', |
| 796 | 'global' => [ |
| 797 | 'default' => Global_Typography::TYPOGRAPHY_PRIMARY, |
| 798 | ], |
| 799 | 'selector' => '{{WRAPPER}} .entry-info, {{WRAPPER}} .entry-info a', |
| 800 | 'condition' => array( |
| 801 | 'show_info' => 'yes', |
| 802 | ), |
| 803 | ) |
| 804 | ); |
| 805 | |
| 806 | $this->add_responsive_control( |
| 807 | 'info_margin_bottom', |
| 808 | array( |
| 809 | 'label' => __( 'Bottom space', 'auxin-elements' ), |
| 810 | 'type' => Controls_Manager::SLIDER, |
| 811 | 'range' => array( |
| 812 | 'px' => array( |
| 813 | 'max' => 100 |
| 814 | ) |
| 815 | ), |
| 816 | 'selectors' => array( |
| 817 | '{{WRAPPER}} .entry-info' => 'margin-bottom: {{SIZE}}{{UNIT}};' |
| 818 | ), |
| 819 | 'condition' => array( |
| 820 | 'show_info' => 'yes' |
| 821 | ) |
| 822 | ) |
| 823 | ); |
| 824 | |
| 825 | $this->add_responsive_control( |
| 826 | 'info_spacing_between', |
| 827 | array( |
| 828 | 'label' => __( 'Space between metas', 'auxin-elements' ), |
| 829 | 'type' => Controls_Manager::SLIDER, |
| 830 | 'range' => array( |
| 831 | 'px' => array( |
| 832 | 'max' => 30 |
| 833 | ) |
| 834 | ), |
| 835 | 'selectors' => array( |
| 836 | '{{WRAPPER}} .entry-info [class^="entry-"] + [class^="entry-"]:before, {{WRAPPER}} .entry-info .entry-tax a:after' => |
| 837 | 'margin-right: {{SIZE}}{{UNIT}}; margin-left: {{SIZE}}{{UNIT}};' |
| 838 | ), |
| 839 | 'condition' => array( |
| 840 | 'show_info' => 'yes' |
| 841 | ) |
| 842 | ) |
| 843 | ); |
| 844 | |
| 845 | $this->end_controls_section(); |
| 846 | |
| 847 | /*-----------------------------------------------------------------------------------*/ |
| 848 | /* content_style_section |
| 849 | /*-----------------------------------------------------------------------------------*/ |
| 850 | |
| 851 | $this->start_controls_section( |
| 852 | 'content_style_section', |
| 853 | array( |
| 854 | 'label' => __( 'Excerpt', 'auxin-elements' ), |
| 855 | 'tab' => Controls_Manager::TAB_STYLE, |
| 856 | 'condition' => array( |
| 857 | 'show_excerpt' => 'yes', |
| 858 | ) |
| 859 | ) |
| 860 | ); |
| 861 | |
| 862 | $this->add_control( |
| 863 | 'content_color', |
| 864 | array( |
| 865 | 'label' => __( 'Color', 'auxin-elements' ), |
| 866 | 'type' => Controls_Manager::COLOR, |
| 867 | 'selectors' => array( |
| 868 | '{{WRAPPER}} .entry-content' => 'color: {{VALUE}};', |
| 869 | ), |
| 870 | 'condition' => array( |
| 871 | 'show_excerpt' => 'yes', |
| 872 | ), |
| 873 | ) |
| 874 | ); |
| 875 | |
| 876 | $this->add_group_control( |
| 877 | Group_Control_Typography::get_type(), |
| 878 | array( |
| 879 | 'name' => 'content_typography', |
| 880 | 'global' => [ |
| 881 | 'default' => Global_Typography::TYPOGRAPHY_PRIMARY, |
| 882 | ], |
| 883 | 'selector' => '{{WRAPPER}} .entry-content', |
| 884 | 'condition' => array( |
| 885 | 'show_excerpt' => 'yes', |
| 886 | ), |
| 887 | ) |
| 888 | ); |
| 889 | |
| 890 | $this->add_responsive_control( |
| 891 | 'content_margin_bottom', |
| 892 | array( |
| 893 | 'label' => __( 'Bottom space', 'auxin-elements' ), |
| 894 | 'type' => Controls_Manager::SLIDER, |
| 895 | 'range' => array( |
| 896 | 'px' => array( |
| 897 | 'max' => 100, |
| 898 | ), |
| 899 | ), |
| 900 | 'selectors' => array( |
| 901 | '{{WRAPPER}} .entry-content' => 'margin-bottom: {{SIZE}}{{UNIT}};', |
| 902 | ), |
| 903 | 'condition' => array( |
| 904 | 'show_excerpt' => 'yes', |
| 905 | ), |
| 906 | ) |
| 907 | ); |
| 908 | |
| 909 | $this->end_controls_section(); |
| 910 | |
| 911 | /*-----------------------------------------------------------------------------------*/ |
| 912 | /* meta_style_section |
| 913 | /*-----------------------------------------------------------------------------------*/ |
| 914 | |
| 915 | $this->start_controls_section( |
| 916 | 'meta_style_section', |
| 917 | array( |
| 918 | 'label' => __( 'Meta', 'auxin-elements' ), |
| 919 | 'tab' => Controls_Manager::TAB_STYLE |
| 920 | ) |
| 921 | ); |
| 922 | |
| 923 | $this->start_controls_tabs( 'meta_colors' ); |
| 924 | |
| 925 | $this->start_controls_tab( |
| 926 | 'meta_color_normal', |
| 927 | array( |
| 928 | 'label' => __( 'Normal' , 'auxin-elements' ), |
| 929 | ) |
| 930 | ); |
| 931 | |
| 932 | $this->add_control( |
| 933 | 'meta_color', |
| 934 | array( |
| 935 | 'label' => __( 'Color', 'auxin-elements' ), |
| 936 | 'type' => Controls_Manager::COLOR, |
| 937 | 'selectors' => array( |
| 938 | '{{WRAPPER}} .entry-meta a, {{WRAPPER}} .entry-meta, {{WRAPPER}} .entry-meta span' => 'color: {{VALUE}}; border-color: {{VALUE}};', |
| 939 | ) |
| 940 | ) |
| 941 | ); |
| 942 | |
| 943 | $this->end_controls_tab(); |
| 944 | |
| 945 | $this->start_controls_tab( |
| 946 | 'meta_color_hover', |
| 947 | array( |
| 948 | 'label' => __( 'Hover' , 'auxin-elements' ) |
| 949 | ) |
| 950 | ); |
| 951 | |
| 952 | $this->add_control( |
| 953 | 'meta_hover_color', |
| 954 | array( |
| 955 | 'label' => __( 'Color', 'auxin-elements' ), |
| 956 | 'type' => Controls_Manager::COLOR, |
| 957 | 'selectors' => array( |
| 958 | '{{WRAPPER}} .entry-meta a:hover, {{WRAPPER}} .entry-meta span:hover' => 'color: {{VALUE}}; border-color: {{VALUE}};', |
| 959 | ) |
| 960 | ) |
| 961 | ); |
| 962 | |
| 963 | $this->end_controls_tab(); |
| 964 | |
| 965 | $this->end_controls_tabs(); |
| 966 | |
| 967 | $this->add_group_control( |
| 968 | Group_Control_Typography::get_type(), |
| 969 | array( |
| 970 | 'name' => 'meta_typography', |
| 971 | 'global' => [ |
| 972 | 'default' => Global_Typography::TYPOGRAPHY_PRIMARY, |
| 973 | ], |
| 974 | 'selector' => '{{WRAPPER}} .entry-meta, {{WRAPPER}} .entry-meta a, {{WRAPPER}} .entry-meta span' |
| 975 | ) |
| 976 | ); |
| 977 | |
| 978 | $this->add_responsive_control( |
| 979 | 'meta_margin_bottom', |
| 980 | array( |
| 981 | 'label' => __( 'Bottom space', 'auxin-elements' ), |
| 982 | 'type' => Controls_Manager::SLIDER, |
| 983 | 'range' => array( |
| 984 | 'px' => array( |
| 985 | 'max' => 100, |
| 986 | ), |
| 987 | ), |
| 988 | 'selectors' => array( |
| 989 | '{{WRAPPER}} .entry-meta' => 'margin-bottom: {{SIZE}}{{UNIT}};', |
| 990 | ) |
| 991 | ) |
| 992 | ); |
| 993 | |
| 994 | $this->end_controls_section(); |
| 995 | } |
| 996 | |
| 997 | /** |
| 998 | * Render image box widget output on the frontend. |
| 999 | * |
| 1000 | * Written in PHP and used to generate the final HTML. |
| 1001 | * |
| 1002 | * @since 1.0.0 |
| 1003 | * @access protected |
| 1004 | */ |
| 1005 | protected function render() { |
| 1006 | |
| 1007 | $settings = $this->get_settings_for_display(); |
| 1008 | |
| 1009 | $args = array( |
| 1010 | // Layout Section |
| 1011 | 'show_media' => $settings['show_media'], |
| 1012 | 'preloadable' => $settings['preloadable'], |
| 1013 | 'preload_preview' => $settings['preload_preview'], |
| 1014 | 'preload_bgcolor' => $settings['preload_bgcolor'], |
| 1015 | 'display_title' => $settings['display_title'], |
| 1016 | 'show_info' => $settings['show_info'], |
| 1017 | 'display_categories' => $settings['display_categories'], |
| 1018 | 'max_taxonomy_num' => $settings['max_taxonomy_num'], |
| 1019 | 'show_date' => $settings['show_date'], |
| 1020 | 'display_comments' => $settings['display_comments'], |
| 1021 | 'display_like' => $settings['display_like'], |
| 1022 | 'show_excerpt' => $settings['show_excerpt'], |
| 1023 | 'excerpt_len' => $settings['excerpt_len'], |
| 1024 | 'excerpt_length' => $settings['excerpt_length'], |
| 1025 | 'author_or_readmore' => $settings['author_or_readmore'], |
| 1026 | 'display_author_footer' => $settings['display_author_footer'], |
| 1027 | 'display_author_header' => $settings['display_author_header'], |
| 1028 | |
| 1029 | // Query Section |
| 1030 | 'cat' => $settings['cat'], |
| 1031 | 'num' => $settings['num'], |
| 1032 | 'exclude_without_media' => $settings['exclude_without_media'], |
| 1033 | 'exclude_custom_post_formats' => $settings['exclude_custom_post_formats'], |
| 1034 | 'exclude_quote_link' => $settings['exclude_quote_link'], |
| 1035 | 'order_by' => $settings['order_by'], |
| 1036 | 'order' => $settings['order'], |
| 1037 | 'only_posts__in' => $settings['only_posts__in'], |
| 1038 | 'include' => $settings['include'], |
| 1039 | 'exclude' => $settings['exclude'], |
| 1040 | 'offset' => $settings['offset'], |
| 1041 | |
| 1042 | // Paginate Section |
| 1043 | 'loadmore_type' => $settings['loadmore_type'], |
| 1044 | |
| 1045 | // Style section |
| 1046 | 'image_aspect_ratio' => $settings['image_aspect_ratio'] |
| 1047 | ); |
| 1048 | |
| 1049 | // get the shortcode base blog page |
| 1050 | echo auxin_widget_recent_posts_land_style_callback( $args ); |
| 1051 | |
| 1052 | } |
| 1053 | |
| 1054 | } |
| 1055 |