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
<?php | |
/** | |
* | |
* In cases where pre_get_posts changes the 'post_type' query var to post (or another post type) | |
* if the original query 'post_type' is 'tribe_events' then reset so that the calendar list views | |
* continue to work properly. | |
* | |
*/ |
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
<?php | |
/* | |
Plugin Name: The Events Calendar: Random Event Widget | |
Description: This widget will display an upcoming random event (and details) in your sidebar. | |
Version: 1.0 | |
Author: jonahcoyote | |
Author URI: http://tri.be?ref=tec-plugin | |
Text Domain: tribe-widget-random-event | |
License: GPLv2 or later | |
*/ |
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
<?php | |
/** | |
* Fix compatibility issues with The Event Calendar and Posts 2 Posts WordPress Plugins | |
* Issue arrises with how nested select queries function when P2P expects a single column. | |
*/ | |
function tribe_to_p2p_pre_get_posts_20121001( $query ){ | |
if(isset($query->_p2p_capture) && $query->_p2p_capture) { | |
add_filter( 'posts_fields', 'tribe_to_p2p_setupFields_20121001', 20); |
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
<?php | |
if( class_exists( 'TribeEventsPro' ) ) : | |
$venue_name = tribe_get_venue_link( $post_id, false ); | |
else : | |
$venue_name = tribe_get_venue( $post_id ); | |
endif; | |
echo !empty($venue_name) ? $venue_name . ', ' : ''; |
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
<?php | |
$special_var = ''; | |
foreach($rows as $row){ | |
$page_links = $row[ 'callout_block_pages' ]; | |
if( is_array( $page_links ) && in_array( $page_url, $page_links ) ) { | |
$special_var = '<article class="'. $row[ 'callout_background_color' ] .'"><a href="'. $row[ 'callout_link' ] .'" rel="bookmark">'. $row[ 'callout_title' ]. '</a></article>'; | |
} | |
} | |
if(!empty($special_var)) { |
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
<?php | |
// REPLACE YOUR CURRENT FUNCTION WITH THE FOLLOWING `get_facebook_photo` (line 268) | |
/** | |
* retrieve a facebook event photo url (after redirect) along with photo data | |
* example: https://graph.facebook.com/331218348435/?fields=picture&type=large | |
* | |
* @param string $object_id the object to retrieve | |
* @param string $size the size of the photo to retrieve (small, normal, large) |
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
tribe_get_event_categories( get_the_ID(), array( | |
'before' => '<>', | |
'sep' => ', ', | |
'after' => '', | |
'label' => '', | |
'label_before' => '', | |
'label_after' => '', | |
'wrap_before' => '', | |
'wrap_after' => '' | |
)); |
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
/** | |
* retrieve a facebook event photo url (after redirect) along with photo data | |
* example: https://graph.facebook.com/331218348435/?fields=picture&type=large | |
* | |
* @param string $object_id the object to retrieve | |
* @param string $size the size of the photo to retrieve (small, normal, large) | |
* @return array the image url | |
*/ | |
function get_facebook_photo( $object_id, $size = 'large' ) { | |
// $api_url = $this->build_url_with_access_token( $object_id . '/picture', array('type' => $size) ); |
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
<?php | |
/** | |
* There is an issue in WordPress v3.5 causing an error of in_admin() when loading the community pages. | |
* Here is the fix: | |
* 1. open lib/tribe-community-events.class.php (in your community events plugin folder) | |
* 2. comment out the line add_action( 'wp', array( $this, 'maybeLoadAssets' ) ); | |
* 3. replace function init() with the one provided below | |
*/ |