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 some JS to photo view that instructs Isotope to use a different | |
* layout mode ("fitRows"), which some may feel offers a more chronologically | |
* accurate view of events. | |
* | |
* Supporting CSS changes may also be needed for the best possible result. | |
*/ | |
add_action( 'wp_footer', function() { | |
if ( ! function_exists( 'tribe_is_photo' ) || ! tribe_is_photo() ) { |
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 | |
/** | |
* Display the same range of events within map view as are shown in regular list view. | |
*/ | |
add_action( 'init', function() { | |
if ( class_exists( 'Tribe__Events__Pro__Geo_Loc' ) ) { | |
$ecp_geoloc = Tribe__Events__Pro__Geo_Loc::instance(); | |
remove_action( 'tribe_events_pre_get_posts', array( $ecp_geoloc, 'setup_geoloc_in_query' ) ); | |
} | |
} ); |
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_register_event_cat_type_args', function( $args ) { | |
$args['capabilities'] = [ | |
'manage_terms' => 'manage_tribe_events_categories', | |
'edit_terms' => 'manage_tribe_events_categories', | |
'delete_terms' => 'manage_tribe_events_categories', | |
'assign_terms' => 'manage_tribe_events_categories', | |
]; | |
return $args; |
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 | |
Tribe__Tickets_Plus__Commerce__WooCommerce__Main::get_instance()->ticket_add( $event_id, [ | |
'ticket_name' => 'Test ticket ' . uniqid(), | |
'ticket_provider' => 'Tribe__Tickets_Plus__Commerce__WooCommerce__Main', | |
'ticket_price' => '100', | |
'tribe_ticket' => [ | |
'mode' => 'global', | |
'event_capacity' => '100', | |
'capacity' => '' | |
], |
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 ecp_fix_tag_order( $sql, $query ) { | |
// Only modify the main query, if it is a tag archive query | |
if ( ! $query->is_main_query() || ! $query->is_tag() ) { | |
return $sql; | |
} | |
$has_event_start_date = (bool) strpos( $sql, 'AS EventStartDate' ); | |
$orders_by_post_date = (bool) strpos( $sql, 'ORDER BY post_date DESC' ); |
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 Resolve_Tribe_Customizer_JS_Error { | |
static function init() { | |
add_action( 'wp_print_footer_scripts', array( __CLASS__, 'capture' ), 14 ); | |
add_action( 'wp_print_footer_scripts', array( __CLASS__, 'filter' ), 16 ); | |
} | |
static function capture() { | |
ob_start(); | |
} |
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 | |
/** | |
* Delete attendees if the order they are associated with is changed to a status of "refunded". | |
* | |
* Designed to work with Event Tickets Plus 4.7.1. Note that re-stocking of inventory must be | |
* handled separately/by taking advantage of WooCommerce's own facilities for this. | |
*/ | |
class Delete_Attendees_Upon_Refund { | |
static function init() { | |
add_action( 'woocommerce_order_status_refunded', array( __CLASS__, 'on_refund' ) ); |
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 | |
/** | |
* "Filter out" events that have already started from list view. | |
* | |
* This deviates from the default behaviour which will include events | |
* that started in the past but are ongoing (have not yet ended). | |
*/ | |
add_filter( 'posts_where', function( $sql, $query ) { | |
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 | |
function photo_view_reorder_posts( $posts ) { | |
remove_filter( 'the_posts', 'photo_view_reorder_posts' ); | |
return array_reverse( $posts ); | |
} | |
function photo_view_reorder_listen( $query ) { | |
if ( | |
'photo' === $query->get( 'eventDisplay' ) | |
|| tribe_is_ajax_view_request( 'photo' ) |