Skip to content

Instantly share code, notes, and snippets.

@GeoffEW
GeoffEW / fix_for_blurry_phot_view.php
Created January 22, 2019 16:10
Fix for blurry images in the Photo view
<?php
// Fix blurry photo image #jrfm
// To use in functions.php without the PHP opening tag at the top :-)
function tribe_adjust_photo_view_image_size($unfiltered) {
if ( tribe_is_photo() ) {
$filtered = get_the_post_thumbnail( get_the_ID(), 'full' );
@GeoffEW
GeoffEW / change_all_events_link.php
Created March 13, 2018 04:21
change the url of "All Events" to your liking
@GeoffEW
GeoffEW / remove_end_time.php
Created February 18, 2018 06:14
Quick and dirty snippet to remove end time from single meta
<?php
add_filter( 'tribe_events_event_schedule_details_formatting', 'remove_end_time', 10, 2);
function remove_end_time( $formatting_details ) {
$formatting_details['show_end_time'] = 0;
return $formatting_details;
}
@GeoffEW
GeoffEW / single-event.php
Created February 8, 2018 19:35
Adds the list of all recurrences to the single event view
<?php
/* Add this code within the single-event.php template */
if ( function_exists( 'cwd_display_recurring_events' ) ) {
global $post;
echo cwd_display_recurring_events( $post );
}
function cwd_display_recurring_events( $post ) {
@GeoffEW
GeoffEW / email_to_for_organizer_email.php
Created February 8, 2018 00:56
* Convert organizer emails into live "mailto:" links that users can click on.
<?php
/**
* Convert organizer emails into live "mailto:" links that users can click on.
*
* @param $email
* @return string
*/
function organizer_live_email_link( $email ) {
if ( ! is_email( $email ) || ! is_singular( Tribe__Events__Main::POSTTYPE ) ) return $email;
return '<a href="mailto:' . esc_attr( $email ) . '">' . esc_html( $email ) . '</a>';
@GeoffEW
GeoffEW / tribe_move_tickets_in_page.php
Last active October 10, 2017 02:44
Moves tickets when used in a page (not an event)
<?php
function tribe_move_tickets_in_page ( ) {
if ( !class_exists('Tribe__Tickets_Plus__Commerce__WooCommerce__Main') ) return;
// remove default action
remove_action ( 'the_content', array ( Tribe__Tickets_Plus__Commerce__WooCommerce__Main::get_instance(), 'front_end_tickets_form_in_content' ) );
// remove default action
add_action ( 'the_post', array ( Tribe__Tickets_Plus__Commerce__WooCommerce__Main::get_instance(), 'front_end_tickets_form' ) );
}
@GeoffEW
GeoffEW / change_ticket_in_email.php
Last active October 19, 2020 19:07
change_ticket_in_email.php
<?php
function tribe_custom_theme_text ( $translation, $text, $domain ) {
// Put your custom text here in a key => value pair
// Example: 'Text you want to change' => 'This is what it will be changed to'
// The text you want to change is the key, and it is case-sensitive
// The text you want to change it to is the value
// You can freely add or remove key => values, but make sure to separate them with a comma
// This example changes the label "Venue" to "Location", and "Related Events" to "Similar Events"
$custom_text = array(
@GeoffEW
GeoffEW / ce_login_redirect.php
Created September 7, 2017 03:44
The Events Calendar Community Events redirect to custom login form
<?php
/*
* The Events Calendar Community Events redirect to custom login form
*/
add_action ( 'tribe_ce_event_submission_login_form', 'tribe_ce_redirect_login' );
function tribe_ce_redirect_login ( ) {
wp_safe_redirect( site_url('/login/') );
exit;
}
@GeoffEW
GeoffEW / rsvp_control_strings.php
Last active August 30, 2022 07:17
RSVP control of strings
<?php
function tribe_custom_theme_text ( $translation, $text, $domain ) {
$custom_text = array(
'Confirm RSVP' => 'Confirm Reservation',
'RSVP' => 'Reservation',
'Please fill in the RSVP confirmation name and email fields.' => 'Please fill in the Reservation confirmation name and email fields.',
'Send RSVP confirmation to:' => 'Send Reservation confirmation to:'
);
<?php
function tribe_remove_time_single( $settings ) {
if ( is_single() ) {
$settings['time'] = false;
remove_filter( 'tribe_events_event_schedule_details_inner', array( 'Tribe__Events__Timezones', 'append_timezone' ), 10 );
}
return $settings;
}
add_filter( 'tribe_events_event_schedule_details_formatting', 'tribe_remove_time_single' );