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 | |
// use this method to replace the orininal in v1.0.5 (line 273 in the-events-calendar-facebook-importer.php) | |
function get_facebook_photo( $object_id ) { | |
$api_url = $this->build_url_with_access_token( $object_id . '/', array( 'fields' => 'cover', 'return_ssl_resources' => 1 ) ); | |
$api_request = $this->json_retrieve( $api_url ); | |
$new_path = $api_request->cover->source; | |
$get_photo = wp_remote_get( $api_request->cover->source ); | |
// setup return object | |
$photo['url'] = $new_path; |
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 | |
add_action( 'pre_get_posts', 'exclude_events_category' ); | |
function exclude_events_category( $query ) { | |
if ( tribe_is_event() && !tribe_is_day() && !is_single() && !is_tax() && !tribe_is_month() ) { | |
$query->set( 'tax_query', array( | |
array( | |
'taxonomy' => TribeEvents::TAXONOMY, | |
'field' => 'slug', | |
'terms' => array('zoo'), |
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 | |
/*-----------------------------------------------------------------------------------*/ | |
/* Register Taxes for Post Types | |
/*-----------------------------------------------------------------------------------*/ | |
function run_init() { | |
register_taxonomy_for_object_type('category', 'tribe_events'); | |
register_taxonomy_for_object_type('post_tag', 'tribe_events'); | |
register_taxonomy_for_object_type('tribe_events_cat', 'post'); |
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 | |
function filter_ical_description($item, $eventPost) { | |
$description = preg_replace( "/[\n\t\r]/", ' ', strip_tags( strip_shortcodes( $eventPost->post_content ) ) ); | |
$description .= '<a href="http://www.mysite.com">Back to site</a>'; | |
$item[] = 'X-ALT-DESC;FMTTYPE=text/html:' . str_replace( ',','\,', $description ); | |
return $item; | |
} | |
add_filter('tribe_ical_feed_item','filter_ical_description', 10, 2); |
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 | |
//Add to your theme's functions.php | |
add_filter( 'tribe_ical_feed_item', 'tribe_ical_modify_event', 10, 2 ); | |
function tribe_ical_modify_event( $item, $eventPost ) { | |
$searchValue = "DESCRIPTION"; | |
$fl_array = preg_grep('/^' . "$searchValue" . '.*/', $item); | |
$key = array_values($fl_array); | |
$keynum = key($fl_array); |
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 | |
$args = array( | |
'post_status'=>'publish', | |
'post_type'=>array(TribeEvents::VENUE_POST_TYPE), | |
'posts_per_page'=>10, | |
'order'=>'DESC' | |
); | |
$get_posts = null; | |
$get_posts = new WP_Query(); |
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 | |
/*-----------------------------------------------------------------------------------*/ | |
/* Register Category/Tag Support for Events | |
/*-----------------------------------------------------------------------------------*/ | |
function add_category_tag_support() { | |
register_taxonomy_for_object_type('post_tag', 'tribe_events'); | |
register_taxonomy_for_object_type('tribe_events_cat', 'tribe_venue'); | |
} | |
add_action('init','add_category_tag_support'); |
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
/** | |
* Add the field to the checkout | |
**/ | |
add_action('woocommerce_after_order_notes', 'my_custom_checkout_field'); | |
function my_custom_checkout_field( $checkout ) { | |
echo '<div id="my_custom_checkout_field"><h3>'.__('My Field').'</h3>'; | |
/** |
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 | |
$args = array( | |
'post_status'=>'publish', | |
'post_type'=>array(TribeEvents::POSTTYPE), | |
'posts_per_page'=>10, | |
//order by startdate from newest to oldest | |
'meta_key'=>'_EventStartDate', | |
'orderby'=>'_EventStartDate', | |
'order'=>'DESC', |
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 | |
// Add Tribe Event Namespace | |
add_filter( 'rss2_ns', 'events_rss2_namespace' ); | |
function events_rss2_namespace() { | |
echo 'xmlns:ev="http://purl.org/rss/2.0/modules/event/"'; | |
} | |
// Add Event Date to RSS Feeds | |
add_action('rss_item','tribe_rss_feed_add_eventdate'); |