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
/** | |
* Quieten general chatter in Slack channels. | |
* | |
* If a channel is muted, it still pops up in the channel list whenever | |
* users start "chatting". These lines aim to hide those channels unless | |
* an @mention has taken place. | |
* | |
* Apply via dotJS or user style tool of choice! | |
* | |
* @dated 2016-11-15 |
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 | |
/** | |
* Comment/uncomment the PHP CLI directive that loads XDebug. | |
* | |
* Useful for turning XDebug on or off completely, so we can debug | |
* CLI scripts or turn off XDebug *completely* for something of a | |
* performance win. | |
* | |
* Sample usage: | |
* |
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 | |
/** | |
* Checks if the ticket is on sale (in relation to it's start/end sale dates). | |
* | |
* Drop in replacement for the function of the same name bundled in Event Tickets | |
* itself. It converts the ticket start/end sale dates to UTC before making its | |
* comparison. This version should live in a mu-plugin file, ie: | |
* | |
* wp-content/mu-plugins/tribe-events-tickets-is-on-sale-replacement.php | |
* |
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 | |
/** | |
* Assign venues to events. | |
* | |
* Useful after importing a bunch of events via CSV for testing; | |
* finds events without an assigned venue and assigns one at random. | |
*/ | |
$assign_venues_to_events = function() { | |
global $wpdb; |
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 | |
/** | |
* Stub: take action if month view contains no events. | |
* | |
* Currently (in TEC 4.2/4.3) the month view template object does not | |
* reliably determine if there are any events available until late in the request | |
* (and if a Filter Bar filter is applied, it will be too late to perform a | |
* redirect). | |
* | |
* This function works around this to detect if month view is empty nice and |
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 | |
/** | |
* Takes care of modifying the "all" keyword used in the all-recurring-events | |
* view to something else. | |
*/ | |
class Events_Custom_All_Link { | |
protected $keyword = ''; | |
public function __construct( $keyword = 'each' ) { | |
$this->keyword = sanitize_key( $keyword ); |
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 | |
/** | |
* Event tag support exploration. Incomplete. | |
* | |
* This snippet sets out to support /events/tag/(term)/ type URLs in The Events Calendar. | |
* These routes are registered by the plugin yet are not officially supported or used | |
* any place, though some users may try to utilize them in any case. | |
* | |
* This snippet assumes list view is the default view and tries to modify the pagination | |
* links to keep the visitor within the /events/tag/(term)/ part of the events archive |
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 | |
/** | |
* Adds the events post type to the list of supported post types | |
* for Featured Audio purposes. | |
* | |
* This snippet can be added to a custom plugin or to your theme's | |
* functions.php file and integrates The Events Calendar with | |
* Featured Audio. | |
* | |
* @see https://wordpress.org/plugins/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 | |
/** | |
* Scans for recurring events and triggers an update to rebuild the | |
* child posts for each. This is delegated to a scheduled event, so | |
* that it happens in the "background" and doesn't slow down normal | |
* operations. | |
*/ | |
class Rebuild_Recurrence { | |
const WORKER_TASK = 'tribe_63556_task'; | |
const FIX_STATUS = 'tribe_63556_status'; |
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
-- Get the missing order post IDs | |
SELECT post_id as missing_order, | |
-- "Estimate" the date by looking at the next available post's date | |
( | |
SELECT post_date | |
FROM wp_posts | |
WHERE ID > post_id | |
ORDER BY ID ASC | |
LIMIT 1 | |
) as nearest_date |