Skip to content

Instantly share code, notes, and snippets.

@ckpicker
ckpicker / gist:ffe7c737b73e5d581bad
Created November 17, 2014 17:25
The Events Calendar // Dequeue Styles
function dequeue_tribe_styles() {
// Dequeue events calendar stylesheets
wp_dequeue_style( 'tribe-events-full-calendar-style' );
wp_dequeue_style( 'tribe-events-calendar-style' );
wp_dequeue_style( 'tribe-events-calendar-full-mobile-style' );
wp_dequeue_style( 'tribe-events-calendar-mobile-style' );
wp_dequeue_style( 'tribe-events-full-pro-calendar-style' );
wp_dequeue_style( 'tribe-events-calendar-pro-style' );
wp_dequeue_style( 'tribe-events-calendar-full-pro-mobile-style' );
@ckpicker
ckpicker / gist:e44578587d4e127d53ca
Last active January 22, 2021 18:16
Events Calendar 3.6 // Customize 'Event has Passed' notice
add_filter( 'tribe_events_the_notices', 'customize_notice', 10, 2 );
function customize_notice( $html, $notices ) {
//If text is found in notice, then replace it
if( stristr( $html, 'This event has passed.' ) ) {
//Customize the message as needed
$html = str_replace( 'This event has passed.', 'This event has passed and <a href="">add a link</a>.', $html );
}
return $html;
}
@ckpicker
ckpicker / gist:7682707
Created November 27, 2013 20:31
Community Events 3.2 // Hide recurrence on the submission form
add_action( 'wp_head', 'community_add_css' );
function community_add_css() {
if (tribe_is_community_edit_event_page() || tribe_is_community_my_events_page()) {
?>
<style>
.recurrence-row {display:none !important;}
</style>
<?php
}
}
@ckpicker
ckpicker / gist:6143167
Created August 2, 2013 20:25
Add Intro Text to 'My Events' Page in Community
add_action('tribe_events_community_list_before_template', 'customize_community_list_intro_text', 10);
function customize_community_list_intro_text() {
echo '<p>Your HTML code to insert before the list will go here.</p>';
}
@ckpicker
ckpicker / vanilla.js
Created June 5, 2018 13:51
Using vanilla js instead of jquery
import delegate from 'delegate';
const el = {
siteHeader: document.querySelector('.site-header'),
};
/**
* @function toggleMenu
* @description Toggle the menu open and closed
*/
@ckpicker
ckpicker / gist:6357368
Created August 27, 2013 18:41
Community Events // Hide Venue & Organizer dropdowns on Community Add/Edit form
add_action( 'wp_footer', 'community_add_javascript' );
function community_add_javascript() {
if (tribe_is_community_edit_event_page()) {
?>
<script type="text/javascript">
//Hide venue dropdown
jQuery('#event_venue tr:first').hide();
//Hide organizer dropdown
@ckpicker
ckpicker / gist:75fecbc6209538b1daf2
Created July 17, 2014 18:33
Events Calendar 3.6 // Remove End Time in the Schedule Details
add_filter( 'tribe_events_event_schedule_details_formatting', 'remove_end_time', 10, 2);
function remove_end_time( $formatting_details ) {
$formatting_details['show_end_time'] = 0;
return $formatting_details;
}
@ckpicker
ckpicker / gist:b247169a4f124fa6ea7c
Created August 5, 2014 19:40
Events Calendar 3.7 // Query Events by City & Country
<?php
//Retrieve venues that match query criteria
$args = array(
'nopaging' => true,
'post_type'=>'tribe_venue',
//Only query venues in specific locations
'meta_query' => array(
'relation' => 'AND',
//Specific City
array(
@ckpicker
ckpicker / gist:8648753
Created January 27, 2014 13:41
Community Events 3.4 // Hide Organizer dropdowns on Community Add/Edit form
add_action( 'wp_footer', 'community_add_javascript' );
function community_add_javascript() {
if (tribe_is_community_edit_event_page()) {
?>
<script type="text/javascript">
//Hide organizer dropdown
jQuery('#event_organizer tr:eq(1)').hide();
</script>
@ckpicker
ckpicker / gist:8407978
Created January 13, 2014 20:56
Community Events Add-on 3.3 // Add additional required fields
add_filter('tribe_events_community_required_fields', 'add_required_fields');
function add_required_fields() {
return array(
'post_content',
'post_title',
'EventStartDate'
);
}