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
<? | |
// Test early in the request for submitted data | |
if ( isset( $_POST['some-data'] ) ) { | |
// Add to cart or do other work with this data | |
setcookie( 'some-data', $_POST['some-data'] ); | |
// Redirect to prevent resubmissions of the same form | |
header( 'Location: /cart.php' ); | |
exit(); | |
} |
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 | |
/** | |
* Example of searching Eventbrite for events and importing them via | |
* Eventbrite Tickets. | |
* | |
* By design, Eventbrite Tickets 4.4.x allows importing from whichever user | |
* account it has been linked with as well as individual events belonging to | |
* other accounts, which can be specified via their ID or URL. | |
* | |
* This is an example of searching for and importing a broader swathe of |
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 | |
/** | |
* @param string $date (yyyy-mm-dd format) | |
* @param string $timezone | |
* | |
* @return bool|null | |
*/ | |
function is_dst( $date, $timezone ) { | |
try { | |
$datetime = date_create(); |
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 | |
/** | |
* Plugin name: Remove Events No Index Tag | |
* Description: Prevents The Events Calendar from telling search engines not to index various views | |
*/ | |
apply_filters( 'tribe_events_add_no_index_meta', '__return_false' ); |
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 | |
### Example of adding an extra column to the Event Tickets/Event Tickets Plus | |
### attendee table. | |
### | |
### Tested with Event Tickets Plus 4.6.2 | |
# Register our extra column | |
add_filter( 'tribe_tickets_attendee_table_columns', function( $columns ) { | |
$columns['extra'] = 'My extra column'; | |
return $columns; |
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 | |
/** | |
* Ensure that month view 'view all X events' on this day links are functional. | |
* | |
* This is a temporary workaround for a bug in Events Calendar PRO 4.4.20.1. | |
*/ | |
add_filter( 'tribe_get_day_link', function( $url, $date ) { | |
// Intervention is only needed following navigation by ajax | |
if ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) { | |
return $url; |
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 | |
/** | |
* Modified single event template. | |
* | |
* This deviates from the default template by capturing the previous and next | |
* event link HTML and re-using it, preventing the same queries from running | |
* twice unnecessarily. | |
* | |
* @version 4.6.3 | |
*/ |
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 | |
/** | |
* Temporary workaround to try and ensure the default mobile | |
* view is respected and that switching between views is possible | |
* when TEC is running alongside WP SEO. | |
* | |
* Tested with: | |
* | |
* - The Events Calendar 4.6.6 | |
* - WordPress SEO 5.8 |
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 | |
/** | |
* Temporary fix for an Isotope conflict between Events Calendar PRO | |
* and Avada, when the [tribe_events] shortcode is used to embed | |
* photo view. | |
* | |
* Tested with Events Calendar PRO 4.4.19 | |
* and Avada 5.3.0. | |
*/ | |
add_action( 'tribe_events_pro_tribe_events_shortcode_prepare_photo', function() { |