Skip to content

Instantly share code, notes, and snippets.

View bordoni's full-sized avatar
:shipit:
Working on The Events Calendar

Gustavo Bordoni bordoni

:shipit:
Working on The Events Calendar
View GitHub Profile
<?php
add_action( 'tribe_bar_datepicker_caption', 'tec_change_date_picker_text' );
function tec_change_date_picker_text( $caption ){
return 'New Text:';
}
@bordoni
bordoni / patch.diff
Last active August 29, 2015 14:14
Solving a MAP and Venue Templating issue
diff --git a/lib/EmbeddedMaps.php b/lib/EmbeddedMaps.php
index 7cc94c4..d7fd80b 100644
--- a/lib/EmbeddedMaps.php
+++ b/lib/EmbeddedMaps.php
@@ -88,7 +88,7 @@ class TribeEvents_EmbeddedMaps {
$this->embedded_maps[] = array(
'address' => $this->address,
- 'title' => tribe_get_venue( $this->venue_id )
+ 'title' => esc_html( get_the_title( $this->venue_id ) ),
@bordoni
bordoni / _functions.php
Last active August 29, 2015 14:14
Reposition Custom Meta for events
<?php
/*
* If you already have something in your functions.php, please remove these first few lines
*/
add_action( 'init', 'tec_forum_939510', 11 );
function tec_forum_939510(){
remove_action( 'tribe_events_single_event_meta_primary_section_end', array( TribeEventsPro::instance()->single_event_meta, 'additional_fields' ), 10 );
add_action( 'tribe_events_single_meta_details_section_end', array( TribeEventsPro::instance()->single_event_meta, 'additional_fields' ), 10 );
@bordoni
bordoni / function.php
Last active August 29, 2015 14:14
Change the Google Calendar texting and move it to another place
<?php
/*
* If you already have something in your functions.php, please remove these first few lines
*/
function tec_forum_938692() {
// don't show on password protected posts
if ( is_single() && post_password_required() ) {
return;
@bordoni
bordoni / functions.php
Created January 29, 2015 13:02
Moving The Google Calendar and iCalendar links to organizer box
<?php
/*
* If you already have something in your functions.php, please remove these first few lines
*/
// First solution - links below the organizer section
add_action( 'tribe_events_single_meta_organizer_section_end', array( 'TribeiCal', 'single_event_links' ) );
remove_action( 'tribe_events_single_event_after_the_content', array( 'TribeiCal', 'single_event_links' ) );
// Second solution - links on the right of the organizer box (after)
@bordoni
bordoni / functions.php
Last active August 29, 2015 14:14
Event Featured image defaults to venue Featured image then to a Defaults URL
<?php
/*
* If you already have something in your functions.php, please remove these first few lines
*/
add_filter( 'tribe_event_featured_image', 'tec_forum_938271', 11, 3 );
function tec_forum_938271( $featured_image, $post_id, $size ){
if ( ! empty( $featured_image ) ){
return $featured_image;
}
@bordoni
bordoni / gist:a1c7248d60f4726f0845
Created January 28, 2015 13:45
Enqueue the `tribe_js_config` variable on Salient WordPress theme
<?php
/*
* Open your Functions.php file
* On your `nectar_register_js` function after the `wp_register_script` for the `nectarFrontend`, you will append the following code
*/
$js_config_array = array(
'permalink_settings' => get_option( 'permalink_structure' ),
'events_post_type' => TribeEvents::POSTTYPE
);
@bordoni
bordoni / functions.php
Last active August 29, 2015 14:14
Remove HTML from Google Export Link on The Events Calendar
<?php
/*
* If you already have something in your functions.php, please remove these first few lines
*/
add_filter( 'tribe_google_calendar_parameters', 'tec_hook_938252', 11 );
function tec_hook_938252( $params ){
// Since in our code we urlencode you need to first urldecode before doing anything
$params['details'] = urlencode( strip_tags( urldecode( $params['details'] ) ) );
@bordoni
bordoni / sites.md
Last active December 8, 2017 22:50
Fitness