Skip to content

Instantly share code, notes, and snippets.

@jesseeproductions
jesseeproductions / ecp-cat-post-menu
Last active August 29, 2015 14:10
Category Posts in Custom Menu(0.9.5) and the Events Calendar(3.8.1) Get only Future Events in Taxonomy
/*If Event then Query only events starting today or in the future
* category-posts-in-custom-menu\category-posts-in-custom-menu.php
* Add after this (around line 189):
* $query_arr['post_type'] = $tag->object_type;
* and before get_posts
*/
if ($tag->object_type[0] == "tribe_events") {
$query_arr['meta_query'] = array( array(
'key' => '_EventStartDate',
'value' => date('Y-m-d') . ' 00:00:00',
@jesseeproductions
jesseeproductions / ecp-event-count
Created November 21, 2014 14:51
The Events Calendar Get Count of Future Events
/*
* The Events Calendar Get Count of Future Events
*
* @3.8.1
*/
$args = array(
'post_type' => 'tribe_events',
'meta_query' => array(
array(
'key' => '_EventStartDate',
@jesseeproductions
jesseeproductions / ecp-list-widget
Created December 10, 2014 15:38
Add List Widget StyleSheet for the Events Calendar
/*
* Add List Widget StyleSheet for the Events Calendar
* The Events Calendar @3.9
*
*/
add_action( 'wp_print_styles', 'tribe_list_widget_stylesheet' );
function tribe_list_widget_stylesheet() {
wp_enqueue_style( 'widget-calendar-pro-style', TribeEventsPro::instance()->pluginUrl . 'resources/widget-calendar-full.css', array(), apply_filters( 'tribe_events_pro_css_version', TribeEventsPro::VERSION ) );
}
@jesseeproductions
jesseeproductions / ecp-genesis-sharing
Last active August 29, 2015 14:11
The Events Calendar Include Genesis Simple Sharing Above Event Calendar
/**
* The Events Calendar - Include Genesis Simple Sharing Above Single Events Content
*
*/
add_filter( 'tribe_events_single_event_before_the_content', 'tribe_genesis_event_share' );
function tribe_genesis_event_share( $post_info ) {
if ( is_singular('tribe_events') && function_exists( 'genesis_share_get_icon_output' ) ) {
global $Genesis_Simple_Share;
$share = genesis_share_get_icon_output( 'entry-meta', $Genesis_Simple_Share->icons );
@jesseeproductions
jesseeproductions / jp-disable-plugin-updates
Last active July 4, 2018 17:35
Disable Plugin Notifications in WordPress
/* Disable Plugin Notifications in WordPress
* Tested in 4.0
* Add to your theme's function.php and replace 'plugin-directory/plugin-file.php' with the plugin to disable
*
*/
add_filter( 'site_transient_update_plugins', 'jp_filter_plugin_updates' );
function jp_filter_plugin_updates( $value ) {
unset( $value->response['plugin-directory/plugin-file.php'] );
return $value;
}
@jesseeproductions
jesseeproductions / ecp-community-login-list
Created December 17, 2014 14:14
Add Content Below The Events Calendar Community Events Event List Login Form
/*
* Add Content Below The Events Calendar Community Events Event List Login Form
* The Events Calendar @3.9
* Use tribe_is_community_edit_event_page() for the Community Events Add Page
*/
add_action( 'tribe_events_after_view', 'tribe_community_below_list_form' );
function tribe_community_below_list_form() {
if (tribe_is_community_my_events_page() && !is_user_logged_in()) {
?>
@jesseeproductions
jesseeproductions / ecp-eb-islive
Created December 18, 2014 14:58
The Events Calendar check if Event Brite Event is Live
/**
* The Events Calendar check if Event Brite Event is Live
* $eb_is_live returns true if live
* Add an eventid (postid) if not used in the loop to isLive()
*/
$tribe_eventbrite = new Event_Tickets_PRO();
$eb_is_live = $tribe_eventbrite->isLive();
@jesseeproductions
jesseeproductions / ecp-trans-woo-addtocart
Created December 23, 2014 14:41
Translate Add to Cart in WooCommerce Tickets
/*
* Translate Add to Cart in WooCommerce Tickets
* @version 3.9
*
*/
function woocommcere_tickets_filter_translations($translations, $text, $domain) {
if ($domain == 'tribe-wootickets') {
$text = str_ireplace( 'Add to cart', 'Add to cart(Translate)', $text );
@jesseeproductions
jesseeproductions / ecp-rel-events-move
Created January 8, 2015 00:24
The Events Calender Pro - Move Related Events Below Content
/**
* The Events Calender Pro - Move Related Events Below Content
* @3.9
*/
if ( class_exists( 'TribeEventsPro' ) ) {
$related_events = array( TribeEventsPro::instance(), 'register_related_events_view' );
remove_action('tribe_events_single_event_after_the_meta', $related_events );
add_action('tribe_events_single_event_after_the_content', $related_events );
}
@jesseeproductions
jesseeproductions / tec-event-time-gmt
Last active August 29, 2015 14:13
Show End Times for Event and Current GMT Time - The Events Calendar
/* Show End Times for Event and Current GMT Time - The Events Calendar
* *3.9
*
*/
$gmt_offset = ( get_option( 'gmt_offset' ) >= '0' ) ? ' +' . get_option( 'gmt_offset' ) : " " . get_option( 'gmt_offset' );
$gmt_offset = str_replace( array( '.25', '.5', '.75' ), array( ':15', ':30', ':45' ), $gmt_offset );
echo "gmt offset: " . $gmt_offset . "<br>";
echo "event end time actual: " . tribe_get_end_date( $post, false, 'Y-m-d G:i' ) . "<br>";