Changeset 3273977
- Timestamp:
- 04/15/2025 10:40:03 PM (12 months ago)
- Location:
- widget-for-eventbrite-api
- Files:
-
- 8 added
- 24 edited
- 1 copied
-
tags/6.2.2 (copied) (copied from widget-for-eventbrite-api/trunk)
-
tags/6.2.2/admin/class-admin-pages.php (modified) (1 diff)
-
tags/6.2.2/admin/class-admin-settings.php (modified) (1 diff)
-
tags/6.2.2/changelog.txt (modified) (1 diff)
-
tags/6.2.2/frontend/class-frontend.php (modified) (3 diffs)
-
tags/6.2.2/includes/README-TEMPLATE-LOADER.md (added)
-
tags/6.2.2/includes/class-compat-template-loader.php (added)
-
tags/6.2.2/includes/class-simple-template-loader-usage.php (added)
-
tags/6.2.2/includes/class-simple-template-loader.php (added)
-
tags/6.2.2/includes/class-utilities.php (modified) (10 diffs)
-
tags/6.2.2/includes/vendor/gamajo/template-loader/class-gamajo-template-loader.php (modified) (1 diff)
-
tags/6.2.2/includes/widgets/elementor/class-eventbrite-widget-elementor-helpers.php (modified) (4 diffs)
-
tags/6.2.2/readme.txt (modified) (1 diff)
-
tags/6.2.2/templates__free/common_layout_card.php (modified) (1 diff)
-
tags/6.2.2/templates__free/common_layout_widget.php (modified) (1 diff)
-
tags/6.2.2/widget-for-eventbrite-api.php (modified) (2 diffs)
-
tags/6.2.2/widgets/class-widget.php (modified) (3 diffs)
-
trunk/admin/class-admin-pages.php (modified) (1 diff)
-
trunk/admin/class-admin-settings.php (modified) (1 diff)
-
trunk/changelog.txt (modified) (1 diff)
-
trunk/frontend/class-frontend.php (modified) (3 diffs)
-
trunk/includes/README-TEMPLATE-LOADER.md (added)
-
trunk/includes/class-compat-template-loader.php (added)
-
trunk/includes/class-simple-template-loader-usage.php (added)
-
trunk/includes/class-simple-template-loader.php (added)
-
trunk/includes/class-utilities.php (modified) (10 diffs)
-
trunk/includes/vendor/gamajo/template-loader/class-gamajo-template-loader.php (modified) (1 diff)
-
trunk/includes/widgets/elementor/class-eventbrite-widget-elementor-helpers.php (modified) (4 diffs)
-
trunk/readme.txt (modified) (1 diff)
-
trunk/templates__free/common_layout_card.php (modified) (1 diff)
-
trunk/templates__free/common_layout_widget.php (modified) (1 diff)
-
trunk/widget-for-eventbrite-api.php (modified) (2 diffs)
-
trunk/widgets/class-widget.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
widget-for-eventbrite-api/tags/6.2.2/admin/class-admin-pages.php
r3250726 r3273977 180 180 181 181 public function settings_setup() { 182 183 $this->settings_title = esc_html__( 'Display Eventbrite Events Settings', 'widget-for-eventbrite-api' ); 184 182 185 183 186 /* top level -
widget-for-eventbrite-api/tags/6.2.2/admin/class-admin-settings.php
r3250726 r3273977 30 30 $this->version = $version; 31 31 $this->freemius = $freemius; 32 $this->settings_title = esc_html__( 'Display Eventbrite Events Settings', 'widget-for-eventbrite-api' );33 32 parent::__construct(); 34 33 } -
widget-for-eventbrite-api/tags/6.2.2/changelog.txt
r3250726 r3273977 1 = 6.2.2 = 2 Fix multiple issues with WP 6.8 compatability 3 1 4 = 6.2.1 = 2 5 * Fix issue with wizard -
widget-for-eventbrite-api/tags/6.2.2/frontend/class-frontend.php
r3250726 r3273977 11 11 use stdClass; 12 12 use WidgetForEventbriteAPI\Admin\Admin_Settings; 13 use WidgetForEventbriteAPI\Includes\Compat_Template_Loader; 13 14 use WidgetForEventbriteAPI\Includes\ICS; 14 15 use WidgetForEventbriteAPI\Includes\Template_Loader; 16 use WidgetForEventbriteAPI\Includes\Simple_Template_Loader; 15 17 use WidgetForEventbriteAPI\Includes\Eventbrite_Query; 16 18 use WidgetForEventbriteAPI\Includes\Twig; 19 use WidgetForEventbriteAPI\Includes\Utilities; 17 20 use WidgetForEventbriteAPI\Shortcodes\Shortcodes; 18 21 use WP_Block_Type_Registry; … … 131 134 ob_start(); 132 135 $theme = wp_get_theme(); 133 $template_loader = new Template_Loader(); 136 $template_loader = new Compat_Template_Loader(); 137 $p = get_post(); 134 138 $template_loader->set_template_data( array( 135 139 'template_loader' => $template_loader, … … 138 142 'template' => strtolower( $theme->template ), 139 143 'plugin_name' => $this->plugin_name, 140 'utilities' => $this->utilities,144 'utilities' => new Utilities($p), 141 145 'unique_id' => uniqid(), 142 146 'instance' => $wfea_instance_counter, -
widget-for-eventbrite-api/tags/6.2.2/includes/class-utilities.php
r3250726 r3273977 53 53 private $freemius; 54 54 55 private $event; 56 55 57 /** 56 58 * Utilities constructor. … … 73 75 } 74 76 return self::$instance; 77 } 78 79 public function set_event( $event ) { 80 $this->event = $event; 81 } 82 83 public function get_event() { 84 return $this->event; 75 85 } 76 86 … … 281 291 */ 282 292 public function get_booknow_link( $args ) { 283 return $this->format_booknow_link( $args, get_post()->url );293 return $this->format_booknow_link( $args, $this->get_event()->url ); 284 294 } 285 295 … … 300 310 $cta['availability_class'] = 'event__available'; 301 311 $cta['class'] = ( isset( $arg[1] ) ? $arg[1] : 'book-now__link' ); 302 if ( 'completed' == get_post()->status || 'ended' == get_post()->status ) {312 if ( 'completed' == $this->get_event()->status || 'ended' == $this->get_event()->status ) { 303 313 $cta['availability_class'] = 'event__past'; 304 314 if ( $this->get_element( 'past_event_button', $args ) ) { … … 309 319 } 310 320 } 311 if ( 'started' == get_post()->status ) {321 if ( 'started' == $this->get_event()->status ) { 312 322 $cta['availability_class'] = 'event__started'; 313 323 if ( $this->get_element( 'started_event_button', $args ) ) { … … 412 422 413 423 public function get_event_attr( $attr ) { 414 return $this->get_value_by_string( get_post(), $attr );424 return $this->get_value_by_string( $this->get_event(), $attr ); 415 425 } 416 426 … … 428 438 */ 429 439 public function get_event_eb_url( $ext = null ) { 430 $post = get_post();440 $post = $this->get_event(); 431 441 return apply_filters( 'wfea_eb_url', $post->url . $ext ); 432 442 } … … 447 457 */ 448 458 public function get_event_end() { 449 return apply_filters( 'wfea_eventbrite_event_end', get_post()->end );459 return apply_filters( 'wfea_eventbrite_event_end', $this->get_event()->end ); 450 460 } 451 461 … … 465 475 */ 466 476 public function get_event_start() { 467 return apply_filters( 'wfea_eventbrite_event_start', get_post()->start );477 return apply_filters( 'wfea_eventbrite_event_start', $this->get_event()->start ); 468 478 } 469 479 … … 558 568 */ 559 569 public function get_original_booknow_link( $args ) { 560 return $this->format_booknow_link( $args, get_post()->eb_url );570 return $this->format_booknow_link( $args, $this->get_event()->eb_url ); 561 571 } 562 572 -
widget-for-eventbrite-api/tags/6.2.2/includes/vendor/gamajo/template-loader/class-gamajo-template-loader.php
r1784834 r3273977 257 257 258 258 if ( $load && $located ) { 259 load_template( $located, $require_once );259 require_once $located; 260 260 } 261 261 -
widget-for-eventbrite-api/tags/6.2.2/includes/widgets/elementor/class-eventbrite-widget-elementor-helpers.php
r3163179 r3273977 223 223 $events = Eventbrite_Manager::$instance->get_organizations_events( $args, false ); 224 224 if ( !is_wp_error( $events ) ) { 225 wp_send_json( wp_list_pluck( $events->events , 'post_title', 'ID' ) );225 wp_send_json( wp_list_pluck( $events->events ?? array(), 'post_title', 'ID' ) ); 226 226 } 227 227 die; … … 248 248 } 249 249 $events = $this->get_events_list( $args ); 250 $events_options = wp_list_pluck( $events , $option_type );250 $events_options = wp_list_pluck( $events ?? array(), $option_type ); 251 251 $dropdown_options = array(); 252 252 foreach ( $events_options as $event_option ) { … … 282 282 false 283 283 ); 284 $organizations_list = wp_list_pluck( $response->organizations , 'name', 'id' );284 $organizations_list = wp_list_pluck( $response->organizations ?? array(), 'name', 'id' ); 285 285 $organizations_list = array( 286 286 '' => __( 'Select', 'widget-for-eventbrite-api' ), … … 297 297 ); 298 298 if ( !is_wp_error( $subcats ) ) { 299 return wp_list_pluck( $subcats->subcategories , 'name', 'id' );299 return wp_list_pluck( $subcats->subcategories ?? array(), 'name', 'id' ); 300 300 } 301 301 return array(); -
widget-for-eventbrite-api/tags/6.2.2/readme.txt
r3250726 r3273977 2 2 Contributors: fullworks 3 3 Tags: eventbrite, widget, events, eventbrite widget, eventbrite shortcode 4 Tested up to: 6. 75 Stable tag: 6.2. 14 Tested up to: 6.8 5 Stable tag: 6.2.2 6 6 Requires PHP: 7.4 7 7 License: GPL-2.0-or-later -
widget-for-eventbrite-api/tags/6.2.2/templates__free/common_layout_card.php
r3156254 r3273977 16 16 <?php 17 17 $data->args['readmore'] = false; 18 if ( false !== $data->events && $data->events->have_posts()) {19 while ( $data->events->have_posts()) {20 $data-> events->the_post();18 if ( ( $data->events->post_count ?? 0 ) > 0 ) { 19 foreach ( $data->events->posts as $event ) { 20 $data->utilities->set_event( $event ); 21 21 $data->event->booknow = $data->utilities->get_booknow_link( $data->args ); 22 22 $data->event->cta = $data->utilities->get_cta( $data->args ); -
widget-for-eventbrite-api/tags/6.2.2/templates__free/common_layout_widget.php
r3156254 r3273977 22 22 ( ! empty( $data->utilities->get_element( 'style', $data->args ) ) ? '' . esc_attr( $data->utilities->get_element( 'style', $data->args ) ) . '' : '' ) 23 23 ); 24 if ( false !== $data->events && $data->events->have_posts() ){24 if ( ( $data->events->post_count ?? 0) > 0 ) { 25 25 $data->template_loader->get_template_part( 'paginate_links_top' . $data->event->plan); 26 26 ?> 27 27 <div class="eaw-ulx"> 28 <?php while ( $data->events->have_posts()) {29 $data->events->the_post();28 <?php foreach ( $data->events->posts as $event ) { 29 $data->utilities->set_event( $event ); 30 30 $data->event->booknow = $data->utilities->get_booknow_link( $data->args ); 31 31 $data->event->cta = $data->utilities->get_cta( $data->args ); -
widget-for-eventbrite-api/tags/6.2.2/widget-for-eventbrite-api.php
r3250726 r3273977 7 7 * Plugin URI: https://fullworksplugins.com/products/widget-for-eventbrite/ 8 8 * Description: Easily display Eventbrite events on your WordPress site 9 * Version: 6.2. 19 * Version: 6.2.2 10 10 * Requires at least: 5.6 11 11 * Requires PHP: 7.4 … … 42 42 define( 'WIDGET_FOR_EVENTBRITE_API_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); 43 43 define( 'WIDGET_FOR_EVENTBRITE_API_PLUGINS_TOP_DIR', plugin_dir_path( __DIR__ ) ); 44 define( 'WIDGET_FOR_EVENTBRITE_API_PLUGIN_VERSION', '6.2. 1' );44 define( 'WIDGET_FOR_EVENTBRITE_API_PLUGIN_VERSION', '6.2.2' ); 45 45 // Include the plugin autoloader, so we can dynamically include the classes. 46 46 require_once WIDGET_FOR_EVENTBRITE_API_PLUGIN_DIR . 'includes/vendor/autoload.php'; -
widget-for-eventbrite-api/tags/6.2.2/widgets/class-widget.php
r3250726 r3273977 7 7 8 8 use stdClass; 9 use WidgetForEventbriteAPI\Includes\Compat_Template_Loader; 9 10 use WidgetForEventbriteAPI\Includes\Eventbrite_Query; 10 11 use WidgetForEventbriteAPI\Includes\Template_Loader; 12 use WidgetForEventbriteAPI\Includes\Simple_Template_Loader; 11 13 use WidgetForEventbriteAPI\Includes\Utilities; 12 14 use WP_Widget; … … 628 630 $template = 'layout_widget'; 629 631 $theme = wp_get_theme(); 630 $template_loader = new Template_Loader();632 $template_loader = new Compat_Template_Loader(); 631 633 $template_loader->set_template_data( array( 632 634 'template_loader' => $template_loader, … … 635 637 'template' => strtolower( $theme->template ), 636 638 'plugin_name' => 'widget-for-eventbrite-api', 637 'utilities' => $this->utilities,639 'utilities' => new Utilities(get_post()), 638 640 'unique_id' => uniqid(), 639 641 'instance' => $wfea_instance_counter, -
widget-for-eventbrite-api/trunk/admin/class-admin-pages.php
r3250726 r3273977 180 180 181 181 public function settings_setup() { 182 183 $this->settings_title = esc_html__( 'Display Eventbrite Events Settings', 'widget-for-eventbrite-api' ); 184 182 185 183 186 /* top level -
widget-for-eventbrite-api/trunk/admin/class-admin-settings.php
r3250726 r3273977 30 30 $this->version = $version; 31 31 $this->freemius = $freemius; 32 $this->settings_title = esc_html__( 'Display Eventbrite Events Settings', 'widget-for-eventbrite-api' );33 32 parent::__construct(); 34 33 } -
widget-for-eventbrite-api/trunk/changelog.txt
r3250726 r3273977 1 = 6.2.2 = 2 Fix multiple issues with WP 6.8 compatability 3 1 4 = 6.2.1 = 2 5 * Fix issue with wizard -
widget-for-eventbrite-api/trunk/frontend/class-frontend.php
r3250726 r3273977 11 11 use stdClass; 12 12 use WidgetForEventbriteAPI\Admin\Admin_Settings; 13 use WidgetForEventbriteAPI\Includes\Compat_Template_Loader; 13 14 use WidgetForEventbriteAPI\Includes\ICS; 14 15 use WidgetForEventbriteAPI\Includes\Template_Loader; 16 use WidgetForEventbriteAPI\Includes\Simple_Template_Loader; 15 17 use WidgetForEventbriteAPI\Includes\Eventbrite_Query; 16 18 use WidgetForEventbriteAPI\Includes\Twig; 19 use WidgetForEventbriteAPI\Includes\Utilities; 17 20 use WidgetForEventbriteAPI\Shortcodes\Shortcodes; 18 21 use WP_Block_Type_Registry; … … 131 134 ob_start(); 132 135 $theme = wp_get_theme(); 133 $template_loader = new Template_Loader(); 136 $template_loader = new Compat_Template_Loader(); 137 $p = get_post(); 134 138 $template_loader->set_template_data( array( 135 139 'template_loader' => $template_loader, … … 138 142 'template' => strtolower( $theme->template ), 139 143 'plugin_name' => $this->plugin_name, 140 'utilities' => $this->utilities,144 'utilities' => new Utilities($p), 141 145 'unique_id' => uniqid(), 142 146 'instance' => $wfea_instance_counter, -
widget-for-eventbrite-api/trunk/includes/class-utilities.php
r3250726 r3273977 53 53 private $freemius; 54 54 55 private $event; 56 55 57 /** 56 58 * Utilities constructor. … … 73 75 } 74 76 return self::$instance; 77 } 78 79 public function set_event( $event ) { 80 $this->event = $event; 81 } 82 83 public function get_event() { 84 return $this->event; 75 85 } 76 86 … … 281 291 */ 282 292 public function get_booknow_link( $args ) { 283 return $this->format_booknow_link( $args, get_post()->url );293 return $this->format_booknow_link( $args, $this->get_event()->url ); 284 294 } 285 295 … … 300 310 $cta['availability_class'] = 'event__available'; 301 311 $cta['class'] = ( isset( $arg[1] ) ? $arg[1] : 'book-now__link' ); 302 if ( 'completed' == get_post()->status || 'ended' == get_post()->status ) {312 if ( 'completed' == $this->get_event()->status || 'ended' == $this->get_event()->status ) { 303 313 $cta['availability_class'] = 'event__past'; 304 314 if ( $this->get_element( 'past_event_button', $args ) ) { … … 309 319 } 310 320 } 311 if ( 'started' == get_post()->status ) {321 if ( 'started' == $this->get_event()->status ) { 312 322 $cta['availability_class'] = 'event__started'; 313 323 if ( $this->get_element( 'started_event_button', $args ) ) { … … 412 422 413 423 public function get_event_attr( $attr ) { 414 return $this->get_value_by_string( get_post(), $attr );424 return $this->get_value_by_string( $this->get_event(), $attr ); 415 425 } 416 426 … … 428 438 */ 429 439 public function get_event_eb_url( $ext = null ) { 430 $post = get_post();440 $post = $this->get_event(); 431 441 return apply_filters( 'wfea_eb_url', $post->url . $ext ); 432 442 } … … 447 457 */ 448 458 public function get_event_end() { 449 return apply_filters( 'wfea_eventbrite_event_end', get_post()->end );459 return apply_filters( 'wfea_eventbrite_event_end', $this->get_event()->end ); 450 460 } 451 461 … … 465 475 */ 466 476 public function get_event_start() { 467 return apply_filters( 'wfea_eventbrite_event_start', get_post()->start );477 return apply_filters( 'wfea_eventbrite_event_start', $this->get_event()->start ); 468 478 } 469 479 … … 558 568 */ 559 569 public function get_original_booknow_link( $args ) { 560 return $this->format_booknow_link( $args, get_post()->eb_url );570 return $this->format_booknow_link( $args, $this->get_event()->eb_url ); 561 571 } 562 572 -
widget-for-eventbrite-api/trunk/includes/vendor/gamajo/template-loader/class-gamajo-template-loader.php
r1784834 r3273977 257 257 258 258 if ( $load && $located ) { 259 load_template( $located, $require_once );259 require_once $located; 260 260 } 261 261 -
widget-for-eventbrite-api/trunk/includes/widgets/elementor/class-eventbrite-widget-elementor-helpers.php
r3163179 r3273977 223 223 $events = Eventbrite_Manager::$instance->get_organizations_events( $args, false ); 224 224 if ( !is_wp_error( $events ) ) { 225 wp_send_json( wp_list_pluck( $events->events , 'post_title', 'ID' ) );225 wp_send_json( wp_list_pluck( $events->events ?? array(), 'post_title', 'ID' ) ); 226 226 } 227 227 die; … … 248 248 } 249 249 $events = $this->get_events_list( $args ); 250 $events_options = wp_list_pluck( $events , $option_type );250 $events_options = wp_list_pluck( $events ?? array(), $option_type ); 251 251 $dropdown_options = array(); 252 252 foreach ( $events_options as $event_option ) { … … 282 282 false 283 283 ); 284 $organizations_list = wp_list_pluck( $response->organizations , 'name', 'id' );284 $organizations_list = wp_list_pluck( $response->organizations ?? array(), 'name', 'id' ); 285 285 $organizations_list = array( 286 286 '' => __( 'Select', 'widget-for-eventbrite-api' ), … … 297 297 ); 298 298 if ( !is_wp_error( $subcats ) ) { 299 return wp_list_pluck( $subcats->subcategories , 'name', 'id' );299 return wp_list_pluck( $subcats->subcategories ?? array(), 'name', 'id' ); 300 300 } 301 301 return array(); -
widget-for-eventbrite-api/trunk/readme.txt
r3250726 r3273977 2 2 Contributors: fullworks 3 3 Tags: eventbrite, widget, events, eventbrite widget, eventbrite shortcode 4 Tested up to: 6. 75 Stable tag: 6.2. 14 Tested up to: 6.8 5 Stable tag: 6.2.2 6 6 Requires PHP: 7.4 7 7 License: GPL-2.0-or-later -
widget-for-eventbrite-api/trunk/templates__free/common_layout_card.php
r3156254 r3273977 16 16 <?php 17 17 $data->args['readmore'] = false; 18 if ( false !== $data->events && $data->events->have_posts()) {19 while ( $data->events->have_posts()) {20 $data-> events->the_post();18 if ( ( $data->events->post_count ?? 0 ) > 0 ) { 19 foreach ( $data->events->posts as $event ) { 20 $data->utilities->set_event( $event ); 21 21 $data->event->booknow = $data->utilities->get_booknow_link( $data->args ); 22 22 $data->event->cta = $data->utilities->get_cta( $data->args ); -
widget-for-eventbrite-api/trunk/templates__free/common_layout_widget.php
r3156254 r3273977 22 22 ( ! empty( $data->utilities->get_element( 'style', $data->args ) ) ? '' . esc_attr( $data->utilities->get_element( 'style', $data->args ) ) . '' : '' ) 23 23 ); 24 if ( false !== $data->events && $data->events->have_posts() ){24 if ( ( $data->events->post_count ?? 0) > 0 ) { 25 25 $data->template_loader->get_template_part( 'paginate_links_top' . $data->event->plan); 26 26 ?> 27 27 <div class="eaw-ulx"> 28 <?php while ( $data->events->have_posts()) {29 $data->events->the_post();28 <?php foreach ( $data->events->posts as $event ) { 29 $data->utilities->set_event( $event ); 30 30 $data->event->booknow = $data->utilities->get_booknow_link( $data->args ); 31 31 $data->event->cta = $data->utilities->get_cta( $data->args ); -
widget-for-eventbrite-api/trunk/widget-for-eventbrite-api.php
r3250726 r3273977 7 7 * Plugin URI: https://fullworksplugins.com/products/widget-for-eventbrite/ 8 8 * Description: Easily display Eventbrite events on your WordPress site 9 * Version: 6.2. 19 * Version: 6.2.2 10 10 * Requires at least: 5.6 11 11 * Requires PHP: 7.4 … … 42 42 define( 'WIDGET_FOR_EVENTBRITE_API_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); 43 43 define( 'WIDGET_FOR_EVENTBRITE_API_PLUGINS_TOP_DIR', plugin_dir_path( __DIR__ ) ); 44 define( 'WIDGET_FOR_EVENTBRITE_API_PLUGIN_VERSION', '6.2. 1' );44 define( 'WIDGET_FOR_EVENTBRITE_API_PLUGIN_VERSION', '6.2.2' ); 45 45 // Include the plugin autoloader, so we can dynamically include the classes. 46 46 require_once WIDGET_FOR_EVENTBRITE_API_PLUGIN_DIR . 'includes/vendor/autoload.php'; -
widget-for-eventbrite-api/trunk/widgets/class-widget.php
r3250726 r3273977 7 7 8 8 use stdClass; 9 use WidgetForEventbriteAPI\Includes\Compat_Template_Loader; 9 10 use WidgetForEventbriteAPI\Includes\Eventbrite_Query; 10 11 use WidgetForEventbriteAPI\Includes\Template_Loader; 12 use WidgetForEventbriteAPI\Includes\Simple_Template_Loader; 11 13 use WidgetForEventbriteAPI\Includes\Utilities; 12 14 use WP_Widget; … … 628 630 $template = 'layout_widget'; 629 631 $theme = wp_get_theme(); 630 $template_loader = new Template_Loader();632 $template_loader = new Compat_Template_Loader(); 631 633 $template_loader->set_template_data( array( 632 634 'template_loader' => $template_loader, … … 635 637 'template' => strtolower( $theme->template ), 636 638 'plugin_name' => 'widget-for-eventbrite-api', 637 'utilities' => $this->utilities,639 'utilities' => new Utilities(get_post()), 638 640 'unique_id' => uniqid(), 639 641 'instance' => $wfea_instance_counter,
Note: See TracChangeset
for help on using the changeset viewer.