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 | |
/** | |
* Remove featured events from event queries, unless the query | |
* is specifically for featured events. | |
*/ | |
add_action( 'tribe_events_pre_get_posts', function( $query ) { | |
if ( tribe( 'tec.featured_events' )->is_featured_query( $query ) ) { | |
return; | |
} |
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 | |
/** | |
* Unset the cheque payment option if any of the existing cart items happen to | |
* be a ticket for an event which belongs to a specific category. | |
* | |
* @param array $available_gateways | |
* | |
* @return array | |
*/ | |
function maybe_unset_gateway_by_category( $available_gateways ) { |
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 enforce a limit on the length of the submitted title. | |
* | |
* Modify the limit value (`var limit = 65`) according to your needs, etc. | |
* Remember that this is frontend only, nothing is enforced server side. | |
* | |
* Tested with Community Events 4.5.9. | |
*/ | |
add_action( 'tribe_events_community_form', function() { |
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(); | |
} |