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
/* | |
* 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>'; | |
} |
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
/** | |
* 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 ); |
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
/* | |
* 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 ); |
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
/* | |
* 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 ); |
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
/* | |
* 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 ); |
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
/* | |
* 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() ) { |
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
/* | |
* 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'] ) ) { |
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
/* | |
* 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' ) ) { |
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
/* | |
* 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 ) { |
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
/* | |
* 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); |