Skip to content

Instantly share code, notes, and snippets.

@jesseeproductions
jesseeproductions / cctor-expired-msg.php
Created December 31, 2015 13:51
Coupon Creator - Add Expired Message to Print Coupons
/*
* Coupon Creator - Add Expired Message to Print Coupons
* Version 2.1.2
*/
add_action('cctor_print_no_show_coupon', 'cctor_expired_message' );
function cctor_expired_message() {
echo '<h3>Sorry, this coupon has expired.</h3>';
}
@jesseeproductions
jesseeproductions / tribe-fb-category-import.php
Created December 8, 2015 16:52
The Events Calendar Facebook Events - Add Category to Imported Events
/**
* The Events Calendar Facebook Events - Add Category to Imported Events
* change Facebook Event to the name of the event category
* @Version 4.0
*/
add_action( 'tribe_events_facebook_event_created', 'tribe_fb_add_category' );
function tribe_fb_add_category( $event_id ) {
wp_set_object_terms( $event_id, 'Facebook Event', 'tribe_events_cat', false );
@jesseeproductions
jesseeproductions / cctor_img_expiration.php
Created November 9, 2015 13:36
Coupon Creator Pro - Show Expiration Date For Pro Image Coupons
/*
* Show Expiration Date For Pro Image Coupons
* @version 2.1
*/
add_action('cctor_print_template_functions', 'cctor_show_expiration_image_coupons' );
add_action('cctor_shortcode_template_functions', 'cctor_show_expiration_image_coupons' );
function cctor_show_expiration_image_coupons() {
add_action('cctor_img_coupon', 'cctor_pro_show_expiration', 10, 3 );
add_action('cctor_print_image_coupon', 'cctor_pro_show_expiration', 10, 2 );
@jesseeproductions
jesseeproductions / tribe_photo_view_all_events.php
Created October 16, 2015 21:00
The Events Calendar Pro - Show All Events in Photo View
/*
* The Events Calendar Pro - Show All Events in Photo View
* @version 3.12.4
*/
add_action( 'pre_get_posts', 'tribe_photo_view_all_events', 15 );
function tribe_photo_view_all_events( $query ) {
if ( tribe_is_photo() ) {
$query->set( 'posts_per_page', -1 );
@jesseeproductions
jesseeproductions / tribe_add_event_title_to_tickets_title.php
Created October 15, 2015 15:01
The Events Calendar - WooCommerce Tickets - Add Event Title to Product Title
/*
* The Events Calendar - WooCommerce Tickets - Add Event Title to Product Title
* add coding to theme's functions.php
* @version 3.12
*/
add_filter( 'woocommerce_product_title', 'tribe_add_event_title_to_tickets_title', 10 , 2 );
function tribe_add_event_title_to_tickets_title( $title, $product ) {
$product_id = $product->id;
$event_id = get_post_meta($product_id , '_tribe_wooticket_for_event', true );
@jesseeproductions
jesseeproductions / tec-home-event-categories.php
Last active October 14, 2015 20:54
The Events Calendar - Include Events From Certain Categories on Home Page Main Blog
/*
* The Events Calendar - Exclude Events From Certain Categories on Home Page Main Blog
* add coding to theme's functions.php
* @version 3.12
* change convention and meetup to slug of Event Categories to show add new categories by separating by comma and add slug between apostrophes
*/
add_action( 'pre_get_posts', 'home_exclude_events_category' );
function home_exclude_events_category( $query ) {
if ( $query->is_home() && $query->is_main_query() ) {
@jesseeproductions
jesseeproductions / tribe-ical-one-year.php
Last active December 5, 2017 05:18
The Events Calendar Get Events for 1 Year from Today in iCal Export File
/*
* The Events Calendar Get Events for 1 Year from Today in iCal Export File
* add coding to theme's functions.php
* @version 3.12
* trigger export with link: http://yoursite.com/events/?ical=1&year-feed
* change 365 for a different range
*/
add_action( 'pre_get_posts', 'tribe_one_year_ics_export' );
function tribe_one_year_ics_export( WP_Query $query ) {
if ( ! isset( $_GET['ical'] ) || ! isset( $_GET['year-feed'] ) ) {
@jesseeproductions
jesseeproductions / remove-categories-not-replated.php
Last active June 30, 2020 15:07
Removes categories "tech" from list and month views
/*
* The Events Calendar Remove Events from Month and List Views
* add coding to theme's functions.php
* @version 3.12
* modify here with event category slugs: array( 'concert', 'convention' )
*/
add_action( 'pre_get_posts', 'tribe_exclude_events_category_month_list' );
function tribe_exclude_events_category_month_list( $query ) {
if ( isset( $query->query_vars['eventDisplay'] ) && ! is_singular( 'tribe_events' ) ) {
@jesseeproductions
jesseeproductions / tribe-woo-catalog-visible.php
Last active July 16, 2019 13:13
WooCommerce Tickets - Set Catalog visibility to Catalog/search for all Tickets
/*
* The Events Calendar - WooCommerce Tickets - Set Catalog visibility to Catalog/search for all Tickets
* Alternative Hooks:
* wootickets_after_update_ticket
* wootickets_after_create_ticke
* @version 3.12
*/
add_action( 'wootickets_after_save_ticket', 'tribe_events_woo_change_visibility' );
function tribe_events_woo_change_visibility( $ticket_ID ) {
@jesseeproductions
jesseeproductions / tec-comma-cost.php
Last active August 28, 2015 19:28
The Events Calendar - Format Cost to include Comma
/*
* The Events Calendar - Format Cost to include Comma
* Works with $ Symbol, replace with other currency Symbol to work
* @version 3.11.1
*/
add_filter( 'tribe_get_cost', 'tribe_format_cost_field', 15, 3 );
function tribe_format_cost_field ( $cost, $post_id, $with_currency_symbol ) {
$cost_filtered = preg_replace('/[\$,]/', '', $cost);
$cost_pieces = explode(" - ", $cost_filtered);