Skip to content

Instantly share code, notes, and snippets.

@jesseeproductions
jesseeproductions / tribe_change_rsvp_confirmation_msg.php
Created February 12, 2020 15:48
Change the RSVP Confirmation Message
/**
* Change the RSVP Confirmation Message
*
* @param string $translation The translated text.
* @param string $text The text to translate.
* @param string $domain The domain slug of the translated text.
* @param string $context The option context string.
*
* @return string The translated text or the custom text.
*/
@jesseeproductions
jesseeproductions / tribe_change_get_tickets_and_rsvp_now_by_context.php
Created February 11, 2020 18:03
Change the Get Tickets and RSVP Now on List View and Single Events by Context
/**
* Change the Get Tickets and RSVP Now on List View and Single Events by Context
*
* @param string $translation The translated text.
* @param string $text The text to translate.
* @param string $context The option context string.
* @param string $domain The domain slug of the translated text.
*
* @return string The translated text or the custom text.
@jesseeproductions
jesseeproductions / tribe_change_get_tickets_and_rsvp_now.php
Created February 11, 2020 18:01
Change the Get Tickets and RSVP Now on List View and Single Events
/**
* Change the Get Tickets and RSVP Now on List View and Single Events
*
* @param string $translation The translated text.
* @param string $text The text to translate.
* @param string $domain The domain slug of the translated text.
* @param string $context The option context string.
*
* @return string The translated text or the custom text.
*/
<?php
/*
Plugin Name: HubSpot Clear Plugin
Plugin URI: http://tri.be
Version: .5
Activate the plugin to clear the HubSpot Delivery Queue.
Deactivate the plugin immediately after it has been activated.
$event_date = date( 'Y-m-d', current_time( 'timestamp' ) );
$beginning_of_day = strtotime( tribe_beginning_of_day( $event_date ) );
$events_query = tribe_events()->where( 'date_overlaps', $beginning_of_day, tribe_end_of_day( $event_date ) )->get_query();
// create an array of post objects
$events_arr = $events_query->get_posts();
// creates an array of event ids
$event_ids = tribe_events()->where( 'date_overlaps', $beginning_of_day, tribe_end_of_day( $event_date ) )->get_ids();
@jesseeproductions
jesseeproductions / cctor-pro-after-counter-msg.php
Created June 3, 2019 14:05
Coupon Creator Pro After Counter Message
add_action( 'cctor_click_actions', 'cctor_pro_after_counter_msg', 15, 2 );
function cctor_pro_after_counter_msg( $coupon_id, $coupon_expiration = null ) {
if ( ! is_singular( Cctor__Coupon__Main::POSTTYPE ) ) {
return false;
}
if ( ! is_object( $coupon_expiration ) ) {
return false;
}
@jesseeproductions
jesseeproductions / tribe-woo-bcc.php
Created March 26, 2019 15:06
Send Bcc Email for WooCommerce Tickets
/**
* Function adds a BCC header to emails that match our array
*
* based off snippet from https://jessepearson.net/2016/10/adding-bcc-emails-woocommerce/
*
* @param string $headers The default headers being used
* @param string $object The email type/object that is being processed
*/
function tribe_add_bcc_to_certain_emails( $headers, $object ) {
@jesseeproductions
jesseeproductions / tribe-no-sales-tax.php
Created March 13, 2019 17:22
Prevent Sales Tax For Tickets under a certain Event or Post ID
/**
* Prevent Sales Tax For Tickets under a certain Event or Post ID
*/
add_filter( 'tribe_tickets_commerce_paypal_add_to_cart_args', 'tribe_add_tax_rate_to_paypal_transaction', 10, 3 );
function tribe_add_tax_rate_to_paypal_transaction( $args, $php_post, $post ) {
// change 15713 to the event or post id with the tickets that should not collect sales tax
if ( $post->ID === 15713 ) {
$args['tax_rate'] = '00.00';
}
@jesseeproductions
jesseeproductions / tribe-ticket-woo-attendee-delay.php
Created January 29, 2019 17:30
Change Delay of Ticket Creation to Now
/**
* Change Delay of Ticket Creation to Now
*/
add_filter( 'tribe_ticket_generation_delay', 'jp_filter_delay' );
function jp_filter_delay( $timestamp ) {
return date( 'm/d/Y h:i:s a', current_time( 'timestamp' ) );
}
@jesseeproductions
jesseeproductions / couponloop-shortcode-loading.php
Created November 2, 2018 12:44
Load Loop Shortcode in Header if Found in Content
/**
* Load Loop Shortcode in Header if Found in Content
* https://wordpress.stackexchange.com/a/207749
*/
add_action( 'wp_enqueue_scripts', 'cctor_load_resources' );
function cctor_load_resources() {
global $post, $wpdb;
// determine whether this page contains "couponloop" shortcode
$shortcode_found = false;