This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Deletes orphaned 'old' recurring events, after the events have been migrated. | |
* You know you have orphaned events if on the Event admin list the number of All events | |
* and the number of items don't match. | |
* @see https://dl.dropbox.com/scl/fi/tmljvc5fzzpr48arklsbt/shot_250326_225112.png?rlkey=dkg0qjh72zhafasnitbrfokv5&dl=0 | |
* | |
* Creating a database dump before and running a test on a staging site first is recommended! | |
* Creating a database backup before running the snippet on a production site is recommended! | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Deletes Tickets Commerce Orders and related Tickets/Attendees, | |
* which are missing a related event or post. | |
* Creating a database dump before and running a test on a staging site first is recommended. | |
* | |
* Usage: Add the snippet with Code Snippets as a "run once" snippet. | |
* Run the snippet when needed. | |
* | |
* @author: Andras Guseo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Format the event cost by using a space as the thousand separator. | |
* | |
* Usage: Add the snippet with Code Snippets or to your functions.php file. | |
* Enter the cost without a thousand separator, when creating the event. | |
* | |
* @since March 5, 2025 Initial version. | |
* | |
* @param double $cost the event cost |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Set WooCommerce orders for Ticket products to 'completed' status automatically based on certain criteria. | |
* | |
* You can further tweak the behavior by adjusting the snippet: | |
* - based on order status: line 29 | |
* - based on payment gateway: line 36 | |
*/ | |
add_action( 'woocommerce_thankyou', function ( $order_id ) { | |
// Bail if there is no order. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Change the time zone of all events and adjust the UTC times accordingly. | |
* | |
* Usage: Add the snippet with Code Snippets. | |
* Set your target time zone on line 20. | |
* Optional: Set your target time zone abbreviation on line 33. | |
* Save it as a 'Run once' snippet. | |
* Go to the Snippet list and click on 'Run' next to the snippet. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* When importing from Other URL with Event Aggregator, only import/update the event | |
* category, if it hasn't been changed on the destination site yet. | |
* | |
* Usage: Add the snippet with a plugin like Code Snippets, or to the functions.php file. | |
* | |
* @author: Andras Guseo | |
* | |
* Plugins required: The Events Calendar, Event Aggregator |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Block REST API requests coming from Event Aggregator. Basically blocks imports. | |
* It can block other sites trying to siphon events with EA through the "Other URL" source. | |
* | |
* Usage: Add the snippet with a plugin like Code Snippets or to your functions.php file. | |
* | |
* @author: Andras Guseo | |
* | |
* Plugins required: The Events Calendar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Changes the event title and description in the iCal feed which is used to export events or | |
* subscribe to the calendar. Can be used to prank subscribers to the calendar. :) | |
* | |
* Usage: Add the snippet with a plugin like Code Snippets or to your functions.php file. | |
* | |
* @author: Andras Guseo | |
* | |
* Plugins required: The Events Calendar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Insert virtual event meeting URL at the end of the description. | |
* | |
* @param array $item Array of items describing the event in ical format. | |
* @param object $event The event object. | |
* | |
* @return array | |
*/ | |
add_filter( 'tribe_ical_feed_item', function ( $item, $event ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Trash (or delete) orphaned Tickets Commerce tickets. | |
* | |
* Usage: Add the snippet with a plugin like Code Snippets. | |
* Save it as a "Run once" snippet. | |
* Go to the All Snippets page and run the snippet. | |
* | |
* @author: Andras Guseo | |
* |
NewerOlder