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 | |
class Imported_Events_Timezone_Modifier { | |
protected $source; | |
protected $target_timezone; | |
public function __construct( $source, $target_timezone ) { | |
$this->source = $source; | |
$this->target_timezone = $target_timezone; | |
} |
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 | |
/** | |
* Drop a bunch of tables. | |
* | |
* Update the prefix in the foreach definition then run via WP-CLI, | |
* ie "wp eval-file ../path/to/this-script.php". | |
*/ | |
global $wpdb; | |
foreach ( $wpdb->get_col( "SHOW TABLES LIKE 'customer_db_%'" ) as $table ) { |
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 | |
// Don't load directly | |
defined( 'WPINC' ) or die; | |
$selected_terms = array(); | |
$taxonomy_obj = get_taxonomy( $taxonomy ); | |
$ajax_args = array( | |
'taxonomy' => $taxonomy, | |
); |
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 | |
/** | |
* Override for the standard EDD tickets form. Please create this at: | |
* | |
* [your-theme]/tribe-events/eddtickets/tickets.php | |
* | |
* @var bool $must_login | |
*/ | |
global $edd_options; |
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 | |
add_filter( 'tribe_events_community_sanitize_submission', function( $submission) { | |
if ( empty( $_POST['tax_input'] ) ) { | |
return $submission; | |
} | |
$submission['tax_input'] = array(); | |
foreach ( $_POST['tax_input'] as $taxonomy => $terms ) { | |
$taxonomy = filter_var( $taxonomy, FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH ); |
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 | |
// Don't load directly | |
defined( 'WPINC' ) or die; | |
$selected_terms = array(); | |
$taxonomy_obj = get_taxonomy( $taxonomy ); | |
$ajax_args = array( | |
'taxonomy' => $taxonomy, | |
); |
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 | |
function get_woo_ticket_purchaser_name( $ticket_id ) { | |
$wootickets = Tribe__Tickets_Plus__Commerce__WooCommerce__Main::get_instance(); | |
$attendee_objects = $wootickets->get_attendees_by_id( | |
$ticket_id, | |
Tribe__Tickets_Plus__Commerce__WooCommerce__Main::ATTENDEE_OBJECT | |
); | |
if ( count( $attendee_objects ) !== 1 ) { |
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 | |
/** | |
* Updates an Events Calendar PRO-style custom field. | |
* | |
* @param int $post_id | |
* @param string $field_label | |
* @param string $value | |
*/ | |
function update_ecp_custom_field( $post_id, $field_label, $value ) { | |
$custom_fields = (array) tribe_get_option( 'custom-fields' ); |