Skip to content

Commit

Permalink
Merge pull request #18 from mt-support/fix/tecext-342-wrong-tickets-h…
Browse files Browse the repository at this point in the history
…idden

Fix/tecext 342 wrong tickets hidden
  • Loading branch information
andrasguseo authored Dec 10, 2024
2 parents d6e8bf6 + 29dbc65 commit 3cb5157
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
4 changes: 2 additions & 2 deletions plugin.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php
/**
* Plugin Name: Event Tickets Extension: Members Only Tickets
* Plugin URI:
* Plugin URI: https://theeventscalendar.com/extensions/members-only-tickets/
* GitHub Plugin URI: https://github.com/mt-support/tec-labs-members-only-tickets
* Description: Hide or limit purchase of members only tickets.
* Version: 1.0.3
* Version: 1.0.4
* Author: The Events Calendar
* Author URI: https://evnt.is/1971
* License: GPL version 3 or any later version
Expand Down
12 changes: 8 additions & 4 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
Contributors: theeventscalendar
Donate link: https://evnt.is/29
Tags: events, calendar
Requires at least: 4.9
Tested up to: 6.2
Requires PHP: 5.6
Stable tag: 1.0.3
Requires at least: 6.3
Tested up to: 6.7.1
Requires PHP: 7.4
Stable tag: 1.0.4
License: GPL version 3 or any later version
License URI: https://www.gnu.org/licenses/gpl-3.0.html

Expand Down Expand Up @@ -33,6 +33,10 @@ We're always interested in your feedback and our [Help Desk](https://theeventsca

== Changelog ==

= [1.0.4] 2024-12-07 =

* Fix - Make sure the correct tickets are hidden for restricted users.

= [1.0.3] 2023-06-24 =

* Fix - Update to use the new Service_Provider contract in common.
Expand Down
6 changes: 6 additions & 0 deletions src/TEC_Labs/Integrations/Integration_Abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,13 @@ public function get_option( $option, $default = null ) {
* Maybe remove tickets from context.
*
* @since 1.0.0
* @since 1.0.4 Re-index the tickets_on_sale array after removing an item.
*
* @param array $context
* @param string $file
* @param array $name
* @param object $obj
*
* @return array
*/
public function remove_tickets_from_context( $context, $file, $name, $obj ) {
Expand All @@ -73,6 +76,9 @@ public function remove_tickets_from_context( $context, $file, $name, $obj ) {
$on_sale_index = array_search( $ticket->ID, array_column( $context['tickets_on_sale'], 'ID' ) );
unset( $context['tickets'][ $index ] );
unset( $context['tickets_on_sale'][ $on_sale_index ] );

// Re-index the tickets_on_sale array to make sure the old indices don't get mixed up with the new ones.
$context['tickets_on_sale'] = array_values( $context['tickets_on_sale'] );
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/TEC_Labs/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class Plugin extends Service_Provider {
*
* @var string
*/
const VERSION = '1.0.3';
const VERSION = '1.0.4';

/**
* Stores the base slug for the plugin.
Expand Down

0 comments on commit 3cb5157

Please sign in to comment.