Skip to content

Instantly share code, notes, and snippets.

@jesseeproductions
jesseeproductions / cctor-pro-fix-expiration-date.php
Created March 2, 2016 01:30
Coupon Creator Pro - Fix Leap Year Expiration Date
$args = array(
'posts_per_page' => 2000,
'post_type' => 'cctor_coupon',
);
$cctor_exp_update = new WP_Query( $args );
if ( $cctor_exp_update ) {
while ( $cctor_exp_update->have_posts() ) : $cctor_exp_update->the_post();
@jesseeproductions
jesseeproductions / tribe-event-list-target-today.php
Created January 27, 2016 15:54
The Events Calendar - Target a Specific Event List Widget to Only Show Todays Events
/**
* The Events Calendar - Target a Specific Event List Widget to Only Show Todays Events
*
* modify tribe-events-adv-list-widget-2 to id of widget
*/
function tribe_modify_list_widget_args_for_today( $args ) {
$start_date_init = date ( 'Y-m-d' );
$start_date_end = $start_date_init . ' 23:59:59';
@jesseeproductions
jesseeproductions / tribe-tickets-plus-prevent-emails.php
Created January 26, 2016 16:08
Events Tickets Plus - WooCommerce Tickets - Prevent Ticket Email from being sent.
/*
* Events Tickets Plus - WooCommerce Tickets - Prevent Ticket Email from being sent.
* @ Version 4.0
*/
add_action( 'init', 'wootickets_stop_sending_email' );
function wootickets_stop_sending_email() {
if ( class_exists( 'Tribe__Tickets_Plus__Commerce__WooCommerce__Main' ) ) {
$woo = Tribe__Tickets_Plus__Commerce__WooCommerce__Main::get_instance();
remove_filter( 'woocommerce_email_classes', array( $woo, 'add_email_class_to_woocommerce' ) );
add_action( 'woocommerce_email_after_order_table', array( $woo, 'add_tickets_msg_to_email' ) );
@jesseeproductions
jesseeproductions / tribe-tickets-woo-category.php
Created January 25, 2016 15:37
Event Tickets Plus - Add Ticket Category for Ticket Products in WooCommerce
/**
* Event Tickets Plus - Add Ticket Category for Ticket Products in WooCommerce
*
*
*/
add_filter( 'wootickets_after_save_ticket', 'tribe_add_category_to_woocommerce_tickets' );
function tribe_add_category_to_woocommerce_tickets( $event_id ) {
wp_set_object_terms( $event_id, 'Ticket', 'product_cat', true );
@jesseeproductions
jesseeproductions / tribe-offer-structured-data.php
Created January 21, 2016 16:46
The Events Calendar 4.0.5 - Add Basic Offer for Events using Event Infomation
/**
* The Events Calendar 4.0.5 - Add Basic Offer for Events using Event Infomation
*/
add_filter( 'tribe_google_event_data', 'tribe_filter_google_markup', 10, 1 );
function tribe_filter_google_markup( $data ) {
$event_id = get_the_id();
$event_link = get_the_permalink();
$event_cost = get_post_meta ($event_id, '_EventCost', true );
@jesseeproductions
jesseeproductions / tribe-ticket-description-email.php
Last active December 20, 2017 01:58
Event Tickets - Ticket Description in Ticket Email for WooCommerce Tickets
//Add inside the foreach ( $tickets as $ticket ) { }
$ticket_product_id = get_post_meta( $ticket['ticket_id'], '_tribe_wooticket_product', true );
$ticket_product = get_post( $ticket_product_id );
$ticket_description = $ticket_product->post_excerpt;
//Add inside ticket html:
<table class="ticket-details" border="0" cellpadding="0" cellspacing="0" width="100%" align="center">
@jesseeproductions
jesseeproductions / tribe-enable-br-tags-excerpt.php
Created January 13, 2016 16:45
The Events Calendar - Enable Break Tags in Excerpt HTML
/*
* The Events Calendar - Enable Break Tags in Excerpt HTML
*/
add_filter( 'tribe_events_excerpt_allowed_html', 'tribe_add_to_character_filter' );
function tribe_add_to_character_filter( $allowed_html ) {
$base_attrs = array(
'class' => array(),
'id' => array(),
'style' => array(),
@jesseeproductions
jesseeproductions / tribe_genesis_bypass_genesis_do_post_content.php
Created January 7, 2016 18:05
The Events Calendar - Bypass Genesis Content Archive Settings in Event Views
/**
* The Events Calendar - Bypass Genesis Content Archive Settings in Event Views
*
* This snippet overrides the Genesis Content Archive settings for Event Views
*
* Event Template set to: Admin > Events > Settings > Display Tab > Events template > Default Page Template
*/
add_action( 'get_header', 'tribe_genesis_bypass_genesis_do_post_content');
function tribe_genesis_bypass_genesis_do_post_content() {
@jesseeproductions
jesseeproductions / tribe-tickets-subject-change.php
Created January 6, 2016 16:59
Event Tickets - Change Ticket Email Subject
/**
* Event Tickets - Change Ticket Email Subject
*/
add_filter( 'tribe_rsvp_email_subject', 'tribe_change_rsvp_subject' );
function tribe_change_rsvp_subject( $subject ) {
$subject = sprintf( __( 'New Your tickets from %s', 'event-tickets' ), get_bloginfo( 'name' ) );
return $subject;
}
@jesseeproductions
jesseeproductions / cctor_google_font.php
Last active January 5, 2016 13:25
Coupon Creator - Add Google Fonts to Print View
/*
* Coupon Creator - Add Google Fonts to Print View
* Version 2.1.2
*/
add_action('coupon_print_meta', 'cctor_google_fonts_print_view' );
function cctor_google_fonts_print_view() {
echo "<link href='https://fonts.googleapis.com/css?family=Oswald' rel='stylesheet' type='text/css'>";
echo "<link href='https://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>";