Event Tickets - Version 4.11.0.1

Version Description

Download this release

Release Info

Developer ModernTribe
Plugin Icon 128x128 Event Tickets
Version 4.11.0.1
Comparing to
See all releases

Code changes from version 4.11.0 to 4.11.0.1

common/vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInit5333bcc529a2930374ef302a42333fe5::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInitdf20a975dd48ab5f56b700979642bc18::getLoader();
common/vendor/autoload_52.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once dirname(__FILE__) . '/composer'.'/autoload_real_52.php';
6
 
7
- return ComposerAutoloaderInit8a370a7e9c11d2fc409092bdeb56b36e::getLoader();
4
 
5
  require_once dirname(__FILE__) . '/composer'.'/autoload_real_52.php';
6
 
7
+ return ComposerAutoloaderInit30e733ff098f8b6f88c307abb1e15faa::getLoader();
common/vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit5333bcc529a2930374ef302a42333fe5
6
  {
7
  private static $loader;
8
 
@@ -19,15 +19,15 @@ class ComposerAutoloaderInit5333bcc529a2930374ef302a42333fe5
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInit5333bcc529a2930374ef302a42333fe5', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInit5333bcc529a2930374ef302a42333fe5', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
- call_user_func(\Composer\Autoload\ComposerStaticInit5333bcc529a2930374ef302a42333fe5::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInitdf20a975dd48ab5f56b700979642bc18
6
  {
7
  private static $loader;
8
 
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInitdf20a975dd48ab5f56b700979642bc18', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInitdf20a975dd48ab5f56b700979642bc18', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
+ call_user_func(\Composer\Autoload\ComposerStaticInitdf20a975dd48ab5f56b700979642bc18::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
common/vendor/composer/autoload_real_52.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real_52.php generated by xrstf/composer-php52
4
 
5
- class ComposerAutoloaderInit8a370a7e9c11d2fc409092bdeb56b36e {
6
  private static $loader;
7
 
8
  public static function loadClassLoader($class) {
@@ -19,9 +19,9 @@ class ComposerAutoloaderInit8a370a7e9c11d2fc409092bdeb56b36e {
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInit8a370a7e9c11d2fc409092bdeb56b36e', 'loadClassLoader'), true /*, true */);
23
  self::$loader = $loader = new xrstf_Composer52_ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInit8a370a7e9c11d2fc409092bdeb56b36e', 'loadClassLoader'));
25
 
26
  $vendorDir = dirname(dirname(__FILE__));
27
  $baseDir = dirname($vendorDir);
2
 
3
  // autoload_real_52.php generated by xrstf/composer-php52
4
 
5
+ class ComposerAutoloaderInit30e733ff098f8b6f88c307abb1e15faa {
6
  private static $loader;
7
 
8
  public static function loadClassLoader($class) {
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInit30e733ff098f8b6f88c307abb1e15faa', 'loadClassLoader'), true /*, true */);
23
  self::$loader = $loader = new xrstf_Composer52_ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInit30e733ff098f8b6f88c307abb1e15faa', 'loadClassLoader'));
25
 
26
  $vendorDir = dirname(dirname(__FILE__));
27
  $baseDir = dirname($vendorDir);
common/vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInit5333bcc529a2930374ef302a42333fe5
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'T' =>
@@ -203,10 +203,10 @@ class ComposerStaticInit5333bcc529a2930374ef302a42333fe5
203
  public static function getInitializer(ClassLoader $loader)
204
  {
205
  return \Closure::bind(function () use ($loader) {
206
- $loader->prefixLengthsPsr4 = ComposerStaticInit5333bcc529a2930374ef302a42333fe5::$prefixLengthsPsr4;
207
- $loader->prefixDirsPsr4 = ComposerStaticInit5333bcc529a2930374ef302a42333fe5::$prefixDirsPsr4;
208
- $loader->prefixesPsr0 = ComposerStaticInit5333bcc529a2930374ef302a42333fe5::$prefixesPsr0;
209
- $loader->classMap = ComposerStaticInit5333bcc529a2930374ef302a42333fe5::$classMap;
210
 
211
  }, null, ClassLoader::class);
212
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInitdf20a975dd48ab5f56b700979642bc18
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'T' =>
203
  public static function getInitializer(ClassLoader $loader)
204
  {
205
  return \Closure::bind(function () use ($loader) {
206
+ $loader->prefixLengthsPsr4 = ComposerStaticInitdf20a975dd48ab5f56b700979642bc18::$prefixLengthsPsr4;
207
+ $loader->prefixDirsPsr4 = ComposerStaticInitdf20a975dd48ab5f56b700979642bc18::$prefixDirsPsr4;
208
+ $loader->prefixesPsr0 = ComposerStaticInitdf20a975dd48ab5f56b700979642bc18::$prefixesPsr0;
209
+ $loader->classMap = ComposerStaticInitdf20a975dd48ab5f56b700979642bc18::$classMap;
210
 
211
  }, null, ClassLoader::class);
212
  }
event-tickets.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Event Tickets
4
  Plugin URI: http://m.tri.be/1acb
5
  Description: Event Tickets allows you to sell basic tickets and collect RSVPs from any post, page, or event.
6
- Version: 4.11.0
7
  Author: Modern Tribe, Inc.
8
  Author URI: http://m.tri.be/28
9
  License: GPLv2 or later
@@ -13,7 +13,7 @@ Domain Path: /lang/
13
  */
14
 
15
  /*
16
- Copyright 2010-2020 by Modern Tribe Inc and the contributors
17
 
18
  This program is free software; you can redistribute it and/or
19
  modify it under the terms of the GNU General Public License
3
  Plugin Name: Event Tickets
4
  Plugin URI: http://m.tri.be/1acb
5
  Description: Event Tickets allows you to sell basic tickets and collect RSVPs from any post, page, or event.
6
+ Version: 4.11.0.1
7
  Author: Modern Tribe, Inc.
8
  Author URI: http://m.tri.be/28
9
  License: GPLv2 or later
13
  */
14
 
15
  /*
16
+ Copyright 2010-2012 by Modern Tribe Inc and the contributors
17
 
18
  This program is free software; you can redistribute it and/or
19
  modify it under the terms of the GNU General Public License
lang/event-tickets-af.mo CHANGED
Binary file
lang/event-tickets-cs_CZ.mo CHANGED
Binary file
lang/event-tickets-da_DK.mo CHANGED
Binary file
lang/event-tickets-de_DE.mo CHANGED
Binary file
lang/event-tickets-el.mo CHANGED
Binary file
lang/event-tickets-es_ES.mo CHANGED
Binary file
lang/event-tickets-eu.mo CHANGED
Binary file
lang/event-tickets-fr_CA.mo CHANGED
Binary file
lang/event-tickets-hu_HU.mo CHANGED
Binary file
lang/event-tickets-it_IT.mo CHANGED
Binary file
lang/event-tickets-ja.mo CHANGED
Binary file
lang/event-tickets-nb_NO.mo CHANGED
Binary file
lang/event-tickets-nl_NL.mo CHANGED
Binary file
lang/event-tickets-pt_BR.mo CHANGED
Binary file
lang/event-tickets-ro_RO.mo CHANGED
Binary file
lang/event-tickets-ru_RU.mo CHANGED
Binary file
lang/event-tickets-sk_SK.mo CHANGED
Binary file
lang/event-tickets-sq.mo CHANGED
Binary file
lang/event-tickets-sv_SE.mo CHANGED
Binary file
lang/event-tickets.pot CHANGED
@@ -1,14 +1,14 @@
1
- # Copyright (C) 2019-2020 Modern Tribe
2
  # This file is distributed under the same license as the Event Tickets package.
3
  msgid ""
4
  msgstr ""
5
  "Project-Id-Version: Event Tickets 4.11.0\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/event-tickets\n"
7
- "POT-Creation-Date: 2019-12-10 19:48:51+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
- "PO-Revision-Date: 2019-12-10 19:48\n"
12
  "Last-Translator: \n"
13
  "Language-Team: \n"
14
 
1
+ # Copyright (C) 2019 Modern Tribe
2
  # This file is distributed under the same license as the Event Tickets package.
3
  msgid ""
4
  msgstr ""
5
  "Project-Id-Version: Event Tickets 4.11.0\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/event-tickets\n"
7
+ "POT-Creation-Date: 2019-12-09 19:48:51+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
+ "PO-Revision-Date: 2019-12-09 19:48\n"
12
  "Last-Translator: \n"
13
  "Language-Team: \n"
14
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Contributors: ModernTribe, brianjessee, camwynsp, paulkim, sc0ttkclark, aguseo,
4
  Tags: RSVP, events, tickets, event management, calendar, ticket sales, community, registration, api, dates, date, posts, workshop, conference, meeting, seminar, concert, summit, ticket integration, event ticketing
5
  Requires at least: 4.9
6
  Tested up to: 5.3
7
- Stable tag: 4.11.0
8
  Requires PHP: 5.6
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -117,13 +117,18 @@ Currently, the following add-ons are available for Event Tickets:
117
 
118
  == Changelog ==
119
 
 
 
 
 
 
120
  = [4.11] 2019-12-10 =
121
 
122
  * Feature - Add ability to utilize the block ticket template outside of Gutenberg views [132568]
123
  * Feature - Use the block template view for the "classic" editor so they look the same now on the frontend [132568]
124
  * Feature - Implement a copy of tribe-common-styles and restyle the front end tickets block [131117]
125
  * Feature - Add currency formatting by commerce [133179]
126
- * Tweak - Clean up the way we add options to the ticket settings tab in PHP to make it more readable and maintainable [133048]
127
  * Tweak - Add ability to track installed version history. Added `$version_history_slug` and `$latest_version_slug` properties to `Tribe__Tickets_Plus__Main` [133048]
128
  * Tweak - Minimum required WordPress version updated to WordPress 4.9
129
  * Tweak - Added filters: `tribe_tickets_modal_setting`, `tribe_events_tickets_template_`, `tribe_attendee_registration_cart_provider`, `tribe_tickets_commerce_cart_get_tickets_`, `tribe_tickets_commerce_cart_get_ticket_meta`, `tribe_tickets_commerce_cart_get_cart_url_`, `tribe_tickets_commerce_cart_get_checkout_url_`, `tribe_tickets_commerce_cart_get_data`, `tribe_edd_format_amount_decimals`, `tribe_format_amount_decimals`, `tribe_format_amount`, `tribe_format_amount_with_symbol`, `tribe_tickets_commerce_paypal_notify_url`, `tribe_tickets_commerce_paypal_custom_args`, `tribe_tickets_commerce_paypal_add_to_cart_args`, `tribe_tickets_commerce_paypal_gateway_add_to_cart_redirect`, `tribe_tickets_commerce_paypal_invoice_number`, `tribe_tickets_tribe-commerce_cart_url`, `tribe_tickets_tribe-commerce_checkout_url`, `tribe_tickets_availability_check_interval`, `tribe_tickets_checkout_urls`, `tribe_tickets_cart_urls`, `tribe_tickets_availability_check_interval`, `tribe_tickets_checkout_urls`, `tribe_tickets_cart_urls`, `tribe_tickets_order_link_template_already_rendered`, `tribe_tickets_order_link_template_already_rendered`, `tribe_tickets_block_loader_classes`, `tribe_events_tickets_attendee_registration_modal_content`, `tribe_tickets_ticket_block_submit`, `tribe_tickets_loader_text`, `tribe_tickets_modal_loader_classes`, `tribe_tickets_order_link_template_already_rendered`
4
  Tags: RSVP, events, tickets, event management, calendar, ticket sales, community, registration, api, dates, date, posts, workshop, conference, meeting, seminar, concert, summit, ticket integration, event ticketing
5
  Requires at least: 4.9
6
  Tested up to: 5.3
7
+ Stable tag: 4.11.0.1
8
  Requires PHP: 5.6
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
117
 
118
  == Changelog ==
119
 
120
+ = [4.11.0.1] 2019-12-11 =
121
+
122
+ * Fix - Avoid running extra unnecessary queries when registering assets [138390]
123
+ * Fix - Make `Tribe__Tickets__Tickets::get_tickets()` protected to avoid errors with it not being public before upgrading ET+ [138385]
124
+
125
  = [4.11] 2019-12-10 =
126
 
127
  * Feature - Add ability to utilize the block ticket template outside of Gutenberg views [132568]
128
  * Feature - Use the block template view for the "classic" editor so they look the same now on the frontend [132568]
129
  * Feature - Implement a copy of tribe-common-styles and restyle the front end tickets block [131117]
130
  * Feature - Add currency formatting by commerce [133179]
131
+ * Tweak - Clean up the way we add options to the ticket settings tab in PHP to make it more readable and maintainable. [133048]
132
  * Tweak - Add ability to track installed version history. Added `$version_history_slug` and `$latest_version_slug` properties to `Tribe__Tickets_Plus__Main` [133048]
133
  * Tweak - Minimum required WordPress version updated to WordPress 4.9
134
  * Tweak - Added filters: `tribe_tickets_modal_setting`, `tribe_events_tickets_template_`, `tribe_attendee_registration_cart_provider`, `tribe_tickets_commerce_cart_get_tickets_`, `tribe_tickets_commerce_cart_get_ticket_meta`, `tribe_tickets_commerce_cart_get_cart_url_`, `tribe_tickets_commerce_cart_get_checkout_url_`, `tribe_tickets_commerce_cart_get_data`, `tribe_edd_format_amount_decimals`, `tribe_format_amount_decimals`, `tribe_format_amount`, `tribe_format_amount_with_symbol`, `tribe_tickets_commerce_paypal_notify_url`, `tribe_tickets_commerce_paypal_custom_args`, `tribe_tickets_commerce_paypal_add_to_cart_args`, `tribe_tickets_commerce_paypal_gateway_add_to_cart_redirect`, `tribe_tickets_commerce_paypal_invoice_number`, `tribe_tickets_tribe-commerce_cart_url`, `tribe_tickets_tribe-commerce_checkout_url`, `tribe_tickets_availability_check_interval`, `tribe_tickets_checkout_urls`, `tribe_tickets_cart_urls`, `tribe_tickets_availability_check_interval`, `tribe_tickets_checkout_urls`, `tribe_tickets_cart_urls`, `tribe_tickets_order_link_template_already_rendered`, `tribe_tickets_order_link_template_already_rendered`, `tribe_tickets_block_loader_classes`, `tribe_events_tickets_attendee_registration_modal_content`, `tribe_tickets_ticket_block_submit`, `tribe_tickets_loader_text`, `tribe_tickets_modal_loader_classes`, `tribe_tickets_order_link_template_already_rendered`
src/Tribe/Attendee_Registration/View.php CHANGED
@@ -200,17 +200,17 @@ class Tribe__Tickets__Attendee_Registration__View extends Tribe__Template {
200
  return false;
201
  }
202
 
203
- if (
204
- 'Tribe__Tickets_Plus__Commerce__WooCommerce__Main' === get_class( $post_provider )
205
- ) {
206
- /** @var \Tribe__Tickets_Plus__Commerce__WooCommerce__Main $provider */
207
- $provider = tribe( 'tickets-plus.commerce.woo' );
208
- } elseif (
209
- 'Tribe__Tickets_Plus__Commerce__EDD__Main' === get_class( $post_provider )
210
- ) {
211
- /** @var \Tribe__Tickets_Plus__Commerce__EDD__Main $provider */
212
- $provider = tribe( 'tickets-plus.commerce.edd' );
213
- } else {
214
  return;
215
  }
216
 
200
  return false;
201
  }
202
 
203
+ try {
204
+ if ( 'Tribe__Tickets_Plus__Commerce__WooCommerce__Main' === get_class( $post_provider ) ) {
205
+ /** @var \Tribe__Tickets_Plus__Commerce__WooCommerce__Main $provider */
206
+ $provider = tribe( 'tickets-plus.commerce.woo' );
207
+ } elseif ( 'Tribe__Tickets_Plus__Commerce__EDD__Main' === get_class( $post_provider ) ) {
208
+ /** @var \Tribe__Tickets_Plus__Commerce__EDD__Main $provider */
209
+ $provider = tribe( 'tickets-plus.commerce.edd' );
210
+ } else {
211
+ return;
212
+ }
213
+ } catch ( RuntimeException $exception ) {
214
  return;
215
  }
216
 
src/Tribe/Commerce/Currency.php CHANGED
@@ -129,7 +129,6 @@ class Tribe__Tickets__Commerce__Currency {
129
  * @return string
130
  */
131
  public function reverse_currency_symbol_position( $unused_reverse_position, $post_id = null ) {
132
-
133
  return $this->get_currency_symbol_position( $post_id ) !== 'prefix';
134
  }
135
 
@@ -694,15 +693,15 @@ class Tribe__Tickets__Commerce__Currency {
694
  *
695
  * @since 4.11.0
696
  *
697
- * @param string $provider The ticket provider class name.
698
- * @param int $post_id The id of the post with tickets.
699
  *
700
  * @return array
701
  */
702
- public function get_currency_config_for_provider( $providers, $post_id ) {
703
 
704
  if ( ! is_array( $providers ) ) {
705
- $providers[] = $providers;
706
  }
707
 
708
  $currency = [];
@@ -714,12 +713,29 @@ class Tribe__Tickets__Commerce__Currency {
714
  return $currency;
715
  }
716
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
717
  /**
718
  * Get the Currency Formatting Information for a Provider.
719
  *
720
  * @since 4.11.0
721
  *
722
- * @param int $post_id The id of the post with tickets.
723
  * @param string|null $provider The ticket provider class name.
724
  *
725
  * @return array an array of formatting details
129
  * @return string
130
  */
131
  public function reverse_currency_symbol_position( $unused_reverse_position, $post_id = null ) {
 
132
  return $this->get_currency_symbol_position( $post_id ) !== 'prefix';
133
  }
134
 
693
  *
694
  * @since 4.11.0
695
  *
696
+ * @param string $providers The ticket provider class name.
697
+ * @param int|null $post_id The id of the post with tickets.
698
  *
699
  * @return array
700
  */
701
+ public function get_currency_config_for_provider( $providers, $post_id = null ) {
702
 
703
  if ( ! is_array( $providers ) ) {
704
+ $providers = (array) $providers;
705
  }
706
 
707
  $currency = [];
713
  return $currency;
714
  }
715
 
716
+ /**
717
+ * Get the Currency Configuration for all Providers.
718
+ *
719
+ * @since 4.11.1
720
+ *
721
+ * @return array
722
+ */
723
+ public function get_currency_config_for_providers() {
724
+ // Get active providers.
725
+ $providers = Tribe__Tickets__Tickets::modules();
726
+
727
+ // Get provider class names.
728
+ $providers = array_keys( $providers );
729
+
730
+ return $this->get_currency_config_for_provider( $providers );
731
+ }
732
+
733
  /**
734
  * Get the Currency Formatting Information for a Provider.
735
  *
736
  * @since 4.11.0
737
  *
738
+ * @param int|null $post_id The id of the post with tickets.
739
  * @param string|null $provider The ticket provider class name.
740
  *
741
  * @return array an array of formatting details
src/Tribe/Editor/Blocks/Tickets.php CHANGED
@@ -82,90 +82,54 @@ extends Tribe__Editor__Blocks__Abstract {
82
  * @return void
83
  */
84
  public function assets() {
85
- $plugin = Tribe__Tickets__Main::instance();
86
- $providers = tribe( 'tickets.data_api' )->get_providers_for_post( null );
87
- $currency = tribe( 'tickets.commerce.currency' )->get_currency_config_for_provider( $providers, null );
88
 
89
  wp_register_script(
90
- 'wp-utils',
91
  includes_url( '/js/wp-util.js' ),
92
  [ 'jquery', 'underscore' ],
93
  false,
94
  false
95
  );
96
 
97
- wp_enqueue_script( 'wp-utils' );
98
-
99
- $cart_urls = [];
100
- $checkout_urls = [];
101
- $availability_check_interval = apply_filters( 'tribe_tickets_availability_check_interval', 60000 );
102
-
103
- if ( empty( Tribe__Tickets__Tickets::$frontend_script_enqueued ) ) {
104
- if ( ! is_admin() ) {
105
- /**
106
- * Allow providers to add their own checkout URL to the localized list.
107
- *
108
- * @since 4.11.0
109
- *
110
- * @param array $checkout_urls An array to add urls to.
111
- */
112
- $checkout_urls = apply_filters( 'tribe_tickets_checkout_urls', $checkout_urls );
113
-
114
- /**
115
- * Allow providers to add their own cart URL to the localized list.
116
- *
117
- * @since 4.11.0
118
- *
119
- * @param array $cart_urls An array to add urls to.
120
- */
121
- $cart_urls = apply_filters( 'tribe_tickets_cart_urls', $cart_urls );
122
- }
123
-
124
- tribe_asset(
125
- $plugin,
126
- 'tribe-tickets-gutenberg-tickets',
127
- 'tickets-block.js',
128
- [ 'jquery', 'jquery-ui-datepicker', 'wp-utils', 'wp-i18n' ],
129
- null,
130
- [
131
- 'type' => 'js',
132
- 'localize' => [
133
- [
134
- 'name' => 'TribeTicketOptions',
135
- 'data' => [
136
- 'ajaxurl' => admin_url( 'admin-ajax.php', ( is_ssl() ? 'https' : 'http' ) ),
137
- 'availability_check_interval' => $availability_check_interval,
138
- ],
139
- ],
140
- [
141
- 'name' => 'TribeCurrency',
142
- 'data' => [
143
- 'formatting' => json_encode( $currency ),
144
- ],
145
- ],
146
- [
147
- 'name' => 'TribeCartEndpoint',
148
- 'data' => [
149
- 'url' => tribe_tickets_rest_url( '/cart/' ),
150
- ],
151
- ],
152
- [
153
- 'name' => 'TribeMessages',
154
- 'data' => $this->set_messages(),
155
- ],
156
- [
157
- 'name' => 'TribeTicketsURLs',
158
- 'data' => [
159
- 'cart' => $cart_urls,
160
- 'checkout' => $checkout_urls,
161
- ],
162
  ],
163
  ],
164
- ]
165
- );
 
 
 
 
 
 
 
 
 
166
 
167
- Tribe__Tickets__Tickets::$frontend_script_enqueued = true;
168
- }
169
  }
170
 
171
  /**
@@ -187,7 +151,6 @@ extends Tribe__Editor__Blocks__Abstract {
187
  wp_send_json_error( $response );
188
  }
189
 
190
-
191
  // Parse the tickets and create the array for the response
192
  foreach ( $tickets as $ticket_id ) {
193
  $ticket = Tribe__Tickets__Tickets::load_ticket_object( $ticket_id );
82
  * @return void
83
  */
84
  public function assets() {
85
+ $plugin = Tribe__Tickets__Main::instance();
 
 
86
 
87
  wp_register_script(
88
+ 'wp-util-not-in-footer',
89
  includes_url( '/js/wp-util.js' ),
90
  [ 'jquery', 'underscore' ],
91
  false,
92
  false
93
  );
94
 
95
+ wp_enqueue_script( 'wp-util-not-in-footer' );
96
+
97
+ tribe_asset(
98
+ $plugin,
99
+ 'tribe-tickets-gutenberg-tickets',
100
+ 'tickets-block.js',
101
+ [ 'jquery', 'jquery-ui-datepicker', 'wp-util-not-in-footer', 'wp-i18n' ],
102
+ null,
103
+ [
104
+ 'type' => 'js',
105
+ 'localize' => [
106
+ [
107
+ 'name' => 'TribeTicketOptions',
108
+ 'data' => [ 'Tribe__Tickets__Tickets', 'get_asset_localize_data_for_ticket_options' ],
109
+ ],
110
+ [
111
+ 'name' => 'TribeCurrency',
112
+ 'data' => [ 'Tribe__Tickets__Tickets', 'get_asset_localize_data_for_currencies' ],
113
+ ],
114
+ [
115
+ 'name' => 'TribeCartEndpoint',
116
+ 'data' => [
117
+ 'url' => tribe_tickets_rest_url( '/cart/' ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
118
  ],
119
  ],
120
+ [
121
+ 'name' => 'TribeMessages',
122
+ 'data' => $this->set_messages(),
123
+ ],
124
+ [
125
+ 'name' => 'TribeTicketsURLs',
126
+ 'data' => [ 'Tribe__Tickets__Tickets', 'get_asset_localize_data_for_cart_checkout_urls' ],
127
+ ],
128
+ ],
129
+ ]
130
+ );
131
 
132
+ Tribe__Tickets__Tickets::$frontend_script_enqueued = true;
 
133
  }
134
 
135
  /**
151
  wp_send_json_error( $response );
152
  }
153
 
 
154
  // Parse the tickets and create the array for the response
155
  foreach ( $tickets as $ticket_id ) {
156
  $ticket = Tribe__Tickets__Tickets::load_ticket_object( $ticket_id );
src/Tribe/Main.php CHANGED
@@ -4,7 +4,7 @@ class Tribe__Tickets__Main {
4
  /**
5
  * Current version of this plugin
6
  */
7
- const VERSION = '4.11.0';
8
 
9
  /**
10
  * Min required The Events Calendar version
4
  /**
5
  * Current version of this plugin
6
  */
7
+ const VERSION = '4.11.0.1';
8
 
9
  /**
10
  * Min required The Events Calendar version
src/Tribe/Tickets.php CHANGED
@@ -626,7 +626,7 @@ if ( ! class_exists( 'Tribe__Tickets__Tickets' ) ) {
626
  *
627
  * @return Tribe__Tickets__Ticket_Object[] List of ticket objects.
628
  */
629
- public function get_tickets( $post_id ) {}
630
 
631
  /**
632
  * Get attendees for a Post ID / Post type.
@@ -1557,86 +1557,138 @@ if ( ! class_exists( 'Tribe__Tickets__Tickets' ) ) {
1557
  * @param array $tickets
1558
  */
1559
  public static function add_frontend_stock_data( array $tickets ) {
1560
- wp_enqueue_script( 'wp-util' );
 
 
1561
 
1562
- // Add the frontend ticket form script as needed (we do this lazily since right now
1563
- // it's only required for certain combinations of event/ticket
1564
- $plugin = Tribe__Tickets__Main::instance();
1565
- $providers = tribe( 'tickets.data_api' )->get_providers_for_post( null );
1566
- $currency = tribe( 'tickets.commerce.currency' )->get_currency_config_for_provider( $providers, null );
1567
- $cart_urls = [];
1568
- $checkout_urls = [];
1569
- $availability_check_interval = apply_filters( 'tribe_tickets_availability_check_interval', 60000 );
1570
 
1571
- if ( empty( self::$frontend_script_enqueued ) ) {
1572
- if ( ! is_admin() ) {
1573
- /**
1574
- * Allow providers to add their own checkout URL to the localized list.
1575
- *
1576
- * @since 4.11.0
1577
- *
1578
- * @param array $checkout_urls An array to add urls to.
1579
- */
1580
- $checkout_urls = apply_filters( 'tribe_tickets_checkout_urls', $checkout_urls );
1581
-
1582
- /**
1583
- * Allow providers to add their own cart URL to the localized list.
1584
- *
1585
- * @since 4.11.0
1586
- *
1587
- * @param array $cart_urls An array to add urls to.
1588
- */
1589
- $cart_urls = apply_filters( 'tribe_tickets_cart_urls', $cart_urls );
1590
- }
1591
 
1592
- tribe_asset(
1593
- $plugin,
1594
- 'tribe_tickets_frontend_tickets',
1595
- 'frontend-ticket-form.js',
1596
- [ 'jquery' ],
1597
- null,
1598
- [
1599
- 'type' => 'js',
1600
- 'localize' => [
1601
- [
1602
- 'name' => 'TribeTicketOptions',
1603
- 'data' => [
1604
- 'ajaxurl' => admin_url( 'admin-ajax.php', ( is_ssl() ? 'https' : 'http' ) ),
1605
- 'availability_check_interval' => $availability_check_interval,
1606
- ],
1607
- ],
1608
- [
1609
- 'name' => 'TribeCurrency',
1610
- 'data' => [
1611
- 'formatting' => json_encode( $currency ),
1612
- ],
1613
- ],
1614
- [
1615
- 'name' => 'TribeCartEndpoint',
1616
- 'data' => [
1617
- 'url' => tribe_tickets_rest_url( '/cart/' ),
1618
- ],
1619
- ],
1620
- [
1621
- 'name' => 'TribeMessages',
1622
- 'data' => self::set_messages(),
1623
- ],
1624
- [
1625
- 'name' => 'TribeTicketsURLs',
1626
- 'data' => [
1627
- 'cart' => $cart_urls,
1628
- 'checkout' => $checkout_urls,
1629
- ],
1630
  ],
1631
  ],
1632
- ]
1633
- );
1634
- }
 
 
 
 
 
 
 
 
1635
 
1636
  tribe_asset_enqueue( 'tribe_tickets_frontend_tickets' );
 
1637
  self::$frontend_script_enqueued = true;
1638
  }
1639
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1640
  /**
1641
  * Get RSVP and Ticket counts for an event if tickets are currently available.
1642
  *
626
  *
627
  * @return Tribe__Tickets__Ticket_Object[] List of ticket objects.
628
  */
629
+ protected function get_tickets( $post_id ) {}
630
 
631
  /**
632
  * Get attendees for a Post ID / Post type.
1557
  * @param array $tickets
1558
  */
1559
  public static function add_frontend_stock_data( array $tickets ) {
1560
+ if ( is_admin() ) {
1561
+ return;
1562
+ }
1563
 
1564
+ /*
1565
+ * Add the frontend ticket form script as needed (we do this lazily since right now),
1566
+ * it's only required for certain combinations of event/ticket.
1567
+ */
1568
+ if ( ! empty( self::$frontend_script_enqueued ) ) {
1569
+ return;
1570
+ }
 
1571
 
1572
+ $plugin = Tribe__Tickets__Main::instance();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1573
 
1574
+ wp_enqueue_script( 'wp-util' );
1575
+
1576
+ tribe_asset(
1577
+ $plugin,
1578
+ 'tribe_tickets_frontend_tickets',
1579
+ 'frontend-ticket-form.js',
1580
+ [ 'jquery' ],
1581
+ null,
1582
+ [
1583
+ 'type' => 'js',
1584
+ 'localize' => [
1585
+ [
1586
+ 'name' => 'TribeTicketOptions',
1587
+ 'data' => [ __CLASS__, 'get_asset_localize_data_for_ticket_options' ],
1588
+ ],
1589
+ [
1590
+ 'name' => 'TribeCurrency',
1591
+ 'data' => [ __CLASS__, 'get_asset_localize_data_for_currencies' ],
1592
+ ],
1593
+ [
1594
+ 'name' => 'TribeCartEndpoint',
1595
+ 'data' => [
1596
+ 'url' => tribe_tickets_rest_url( '/cart/' ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1597
  ],
1598
  ],
1599
+ [
1600
+ 'name' => 'TribeMessages',
1601
+ 'data' => self::set_messages(),
1602
+ ],
1603
+ [
1604
+ 'name' => 'TribeTicketsURLs',
1605
+ 'data' => [ __CLASS__, 'get_asset_localize_data_for_cart_checkout_urls' ],
1606
+ ],
1607
+ ],
1608
+ ]
1609
+ );
1610
 
1611
  tribe_asset_enqueue( 'tribe_tickets_frontend_tickets' );
1612
+
1613
  self::$frontend_script_enqueued = true;
1614
  }
1615
 
1616
+ /**
1617
+ * Get JS localize data for ticket options.
1618
+ *
1619
+ * @since 4.11.0.1
1620
+ *
1621
+ * @return array JS localize data for ticket options.
1622
+ */
1623
+ public static function get_asset_localize_data_for_ticket_options() {
1624
+ /**
1625
+ * Allow filtering how often tickets availability is checked.
1626
+ *
1627
+ * @since 4.11.0
1628
+ *
1629
+ * @param int $availability_check_interval How often to check availability for tickets.
1630
+ */
1631
+ $availability_check_interval = apply_filters( 'tribe_tickets_availability_check_interval', 60000 );
1632
+
1633
+ return [
1634
+ 'ajaxurl' => admin_url( 'admin-ajax.php', ( is_ssl() ? 'https' : 'http' ) ),
1635
+ 'availability_check_interval' => $availability_check_interval,
1636
+ ];
1637
+ }
1638
+
1639
+ /**
1640
+ * Get JS localize data for currencies.
1641
+ *
1642
+ * @since 4.11.0.1
1643
+ *
1644
+ * @return array JS localize data for currencies.
1645
+ */
1646
+ public static function get_asset_localize_data_for_currencies() {
1647
+ /** @var Tribe__Tickets__Commerce__Currency $currency */
1648
+ $currency = tribe( 'tickets.commerce.currency' );
1649
+
1650
+ $currencies = $currency->get_currency_config_for_providers();
1651
+
1652
+ return [
1653
+ 'formatting' => json_encode( $currencies ),
1654
+ ];
1655
+ }
1656
+
1657
+ /**
1658
+ * Get JS localize data for cart/checkout URLs.
1659
+ *
1660
+ * @since 4.11.0.1
1661
+ *
1662
+ * @return array JS localize data for cart/checkout URLs.
1663
+ */
1664
+ public static function get_asset_localize_data_for_cart_checkout_urls() {
1665
+ $cart_urls = [];
1666
+ $checkout_urls = [];
1667
+
1668
+ /**
1669
+ * Allow providers to add their own checkout URL to the localized list.
1670
+ *
1671
+ * @since 4.11.0
1672
+ *
1673
+ * @param array $checkout_urls An array to add urls to.
1674
+ */
1675
+ $checkout_urls = apply_filters( 'tribe_tickets_checkout_urls', $checkout_urls );
1676
+
1677
+ /**
1678
+ * Allow providers to add their own cart URL to the localized list.
1679
+ *
1680
+ * @since 4.11.0
1681
+ *
1682
+ * @param array $cart_urls An array to add urls to.
1683
+ */
1684
+ $cart_urls = apply_filters( 'tribe_tickets_cart_urls', $cart_urls );
1685
+
1686
+ return [
1687
+ 'cart' => $cart_urls,
1688
+ 'checkout' => $checkout_urls,
1689
+ ];
1690
+ }
1691
+
1692
  /**
1693
  * Get RSVP and Ticket counts for an event if tickets are currently available.
1694
  *
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInit3818c28f88ceef9142adf94536545ae1::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderIniteaf54a0f3fcb999007b792407a2958d8::getLoader();
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit3818c28f88ceef9142adf94536545ae1
6
  {
7
  private static $loader;
8
 
@@ -19,15 +19,15 @@ class ComposerAutoloaderInit3818c28f88ceef9142adf94536545ae1
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInit3818c28f88ceef9142adf94536545ae1', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInit3818c28f88ceef9142adf94536545ae1', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
- call_user_func(\Composer\Autoload\ComposerStaticInit3818c28f88ceef9142adf94536545ae1::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderIniteaf54a0f3fcb999007b792407a2958d8
6
  {
7
  private static $loader;
8
 
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderIniteaf54a0f3fcb999007b792407a2958d8', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderIniteaf54a0f3fcb999007b792407a2958d8', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
+ call_user_func(\Composer\Autoload\ComposerStaticIniteaf54a0f3fcb999007b792407a2958d8::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInit3818c28f88ceef9142adf94536545ae1
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'T' =>
@@ -45,9 +45,9 @@ class ComposerStaticInit3818c28f88ceef9142adf94536545ae1
45
  public static function getInitializer(ClassLoader $loader)
46
  {
47
  return \Closure::bind(function () use ($loader) {
48
- $loader->prefixLengthsPsr4 = ComposerStaticInit3818c28f88ceef9142adf94536545ae1::$prefixLengthsPsr4;
49
- $loader->prefixDirsPsr4 = ComposerStaticInit3818c28f88ceef9142adf94536545ae1::$prefixDirsPsr4;
50
- $loader->classMap = ComposerStaticInit3818c28f88ceef9142adf94536545ae1::$classMap;
51
 
52
  }, null, ClassLoader::class);
53
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticIniteaf54a0f3fcb999007b792407a2958d8
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'T' =>
45
  public static function getInitializer(ClassLoader $loader)
46
  {
47
  return \Closure::bind(function () use ($loader) {
48
+ $loader->prefixLengthsPsr4 = ComposerStaticIniteaf54a0f3fcb999007b792407a2958d8::$prefixLengthsPsr4;
49
+ $loader->prefixDirsPsr4 = ComposerStaticIniteaf54a0f3fcb999007b792407a2958d8::$prefixDirsPsr4;
50
+ $loader->classMap = ComposerStaticIniteaf54a0f3fcb999007b792407a2958d8::$classMap;
51
 
52
  }, null, ClassLoader::class);
53
  }