Skip to content

Instantly share code, notes, and snippets.

@jesseeproductions
jesseeproductions / tec-single-bar.php
Created August 25, 2015 15:21
The Events Calendar - Load Tribe Bar Script on Single Events
/*
* The Events Calendar - Load Tribe Bar Script on Single Events
* @version 3.11.1
*/
add_action( 'template_redirect', 'tribe_admin_bar_script' );
function tribe_admin_bar_script() {
if ( is_singular( 'tribe_events' ) ) {
add_filter( 'tribe-events-bar-should-show', '__return_true' );
//wp_enqueue_script( 'tribe-events-bar' );
@jesseeproductions
jesseeproductions / tec-fb-category.php
Created August 24, 2015 16:05
The Events Calendar - Facebook Events Add Category
/*
* The Events Calendar - Facebook Events Add Category
* TEC Fcebook Events @3.11
*/
add_action( 'added_post_meta', 'tribe_save_fb_event_category', 10, 4 );
function tribe_save_fb_event_category( $meta_id, $post_id, $meta_key, $meta_value ) {
if ( '_EventOrigin' == $meta_key ) {
if( !has_term( '', 'tribe_events_cat', $post_id ) ) {
@jesseeproductions
jesseeproductions / tec-pro-mini-hide-event-list.php
Created August 14, 2015 15:20
The Events Calendar Pro - Hide Mini Calendar Event List Until Calendar Date is Clicked
/*
* The Events Calendar Pro - Hide Mini Calendar Event List Until Calendar Date is Clicked
* TEC PRO @3.11.1
*/
add_action( 'wp_footer', 'tribe_hide_mini_calendar_list_until_clicked', 50 );
function tribe_hide_mini_calendar_list_until_clicked() {
?>
<script>
var $ = jQuery.noConflict();
@jesseeproductions
jesseeproductions / tec-manual-start-end-dates.php
Created August 11, 2015 15:05
The Events Calendar - Manual Display of Date and Time
<code>$datetime_format = 'F j @ H:i';
$tribe_EventStartDate = tribe_get_event_meta( get_the_ID(), '_EventStartDate', true );
$date = strtotime( $tribe_EventStartDate );
echo tribe_event_format_date( $date, true, $datetime_format );
$tribe__EventEndDate = tribe_get_event_meta( get_the_ID(), '_EventEndDate', true );
$date = strtotime( $tribe__EventEndDate );
echo tribe_event_format_date( $date, true, $datetime_format );</code>
@jesseeproductions
jesseeproductions / tec-yoast-title-rewrite.php
Last active August 29, 2015 14:26
The Events Calendar - Yoast SEO - Prevent Yoast from changing Event Title Tags for Event Views (Month, List, Etc,)
/*
* The Events Calendar - Yoast SEO - Prevent Yoast from changing Event Title Tags for Event Views (Month, List, Etc,)
* @TEC - 3.11
* @Yoast - 2.3.4
*/
add_action( 'pre_get_posts', 'tribe_remove_wpseo_title_rewrite', 20 );
function tribe_remove_wpseo_title_rewrite() {
if ( class_exists( 'Tribe__Events__Main' ) && class_exists( 'Tribe__Events__Pro__Main' ) ) {
if( tribe_is_month() || tribe_is_upcoming() || tribe_is_past() || tribe_is_day() || tribe_is_map() || tribe_is_photo() || tribe_is_week() ) {
$wpseo_front = WPSEO_Frontend::get_instance();
@jesseeproductions
jesseeproductions / tec-admin-bar.php
Created July 30, 2015 14:57
The Events Calendar - Remove Events from Admin Bar for all roles, but the admin
<?php
/*
* The Events Calendar - Remove Events from Admin Bar for all roles, but the admin
* @3.11
*
*/
add_action( 'wp_before_admin_bar_render', 'removeToolbarItems' , 10 );
function removeToolbarItems(){
global $wp_admin_bar;
if(!current_user_can('manage_options')){
@jesseeproductions
jesseeproductions / ecp-cost-field.php
Created July 29, 2015 18:46
Returns the contents of the event cost field without applying any formatting tricks.
<?php
/**
* Returns the contents of the event cost field without applying any formatting tricks.
*
* Useful in those cases where a non-standard cost values such as
* "ABC-123" is used, else they may be "mangled" by the
* Tribe__Events__Cost_Utils object.
*
* @param string $cost (unused)
* @param int $post_id
@jesseeproductions
jesseeproductions / tec-ical-gcal-remove.php
Created July 27, 2015 18:33
The Events Calendar - Remove iCal and gCal Links in Event Details of Single Events
/*
* The Events Calendar - Remove iCal and gCal Links in Event Details of Single Events
* @3.11
*
*/
remove_action('tribe_events_single_event_after_the_content', array('Tribe__Events__iCal', 'single_event_links'));
@jesseeproductions
jesseeproductions / ecp-widget-full-de-style
Last active August 29, 2015 14:25
The Events Calendar - Remove Mini Calendar and List Widget Stylesheet
/*
* The Events Calendar - Remove Mini Calendar and List Widget Stylesheet
* @3.10
*
*/
add_action('wp_print_styles', 'events_calendar_remove_styles' , 10 );
add_action('get_footer', 'events_calendar_remove_styles' , 10 );
function events_calendar_remove_styles() {
wp_dequeue_style( 'widget-calendar-pro-style' );
@jesseeproductions
jesseeproductions / tec-genesis-author-box
Last active January 8, 2020 16:01
Genesis Remove Author Box from Single Templates for the The Events Calendar
/*
* Genesis Remove Author Box from Single Templates for the The Events Calendar
* The Events Calendar @3.10
* Genesis @2.1.2
* this adds the filter for testing add_filter( 'get_the_author_genesis_author_box_single', '__return_true' );
* To Do Fixed Trying to get property of non-object notice
*/
add_action( 'pre_get_posts', 'tribe_genesis_hide_author_single_events' );
function tribe_genesis_hide_author_single_events( $query ) {