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