This file contains hidden or 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 | |
| function post_to_bbp_shortcode() { | |
| if ( 'success' === post_to_bbp_status() ) { | |
| return post_to_bbp_success(); | |
| } | |
| else { | |
| return post_to_bbp_form(); | |
| } | |
| } |
This file contains hidden or 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 | |
| /** | |
| * Updates instances of the Countdown Widget so that they always | |
| * point to an event which has not yet started. | |
| * | |
| * This works by intercepting events before the widget is rendered: | |
| * if it looks like the event the widget is targeting has already | |
| * started, the object will select the next upcoming event (if one | |
| * is available) and set the widget to use that instead. | |
| * |
This file contains hidden or 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
| -- Quickly delete all events, organizers and venues | |
| -- and their associated post meta data | |
| -- | |
| -- (The Events Calendar 4.x) | |
| DELETE wp_posts, wp_postmeta FROM wp_posts | |
| INNER JOIN wp_postmeta ON wp_postmeta.post_id = wp_posts.ID | |
| WHERE wp_posts.post_type IN ( | |
| 'tribe_events', | |
| 'tribe_organizer', | |
| 'tribe_venue' |
This file contains hidden or 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 a plain text file and transforms it into a PHP array representation. | |
| * | |
| * Paragraphs are understood to be seperated by blank lines (so if the source | |
| * text exclusively uses a different convention, such as the opening line of | |
| * each paragraph being tabbed in, this won't work without adjustment). | |
| * | |
| * Example source: | |
| * |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 ); |