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 | |
/*-------------------------------------------------------*/ | |
/* Default to List View When Viewing Event Categories | |
/*-------------------------------------------------------*/ | |
add_action( 'pre_get_posts', 'default_to_list_view' ); | |
function default_to_list_view( $query ) { | |
if ( is_tax(TribeEvents::TAXONOMY) && $query->query_vars['post_type'] == TribeEvents::POSTTYPE && empty( $query->query_vars['suppress_filters'] ) ) { | |
$query->set( 'eventDisplay', 'upcoming' ); |
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
function filter_translations($translation, $text, $domain) { | |
if ($domain == 'tribe-events-calendar') { | |
switch ($text) { | |
case 'View All Events': | |
$translation = 'View The Calendar'; | |
break; | |
} | |
} | |
return $translation; |
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 | |
global $post; | |
$all_events = tribe_get_events(array( | |
'eventDisplay'=>'all', | |
'name'=>get_the_title(), | |
'posts_per_page'=>-1 | |
)); | |
?> | |
<ul> |
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 Published Date Column to Tribe Events | |
/*-----------------------------------------------------------------------------------*/ | |
add_filter( 'manage_edit-tribe_events_columns', 'my_edit_tribe_events' ) ; | |
function my_edit_tribe_events( $columns ) { | |
$columns['date'] = __('Date'); | |
return $columns; |
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 | |
/* | |
Template Name: Stock Report :) | |
*/ | |
if (!is_user_logged_in() || !current_user_can('manage_options')) wp_die('This page is private.'); | |
?> | |
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
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 | |
/** | |
* Loop Add to Cart | |
*/ | |
global $product; | |
if( $product->get_price() === '' && $product->product_type != 'external' ) return; | |
?> |
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 | |
/** | |
* Facebook Page Feed Parser | |
* | |
* @using cURL | |
*/ | |
function fb_parse_feed( $page_id, $no = 5 ) { | |
// URL to the Facebook page's RSS feed. |
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 this to your functions.php file to create a venue query that queries venues in order of number of events. | |
// You may need to add a limit statement if you want more events to be returned than the default for the query. | |
add_filter( 'pre_get_posts', 'my_function_to_get_venues_by_event_numbers', 10, 1 ); | |
function my_function_to_get_venues_by_event_numbers( $query ) { | |
$post_type = (array) $query->query_vars['post_type']; | |
if ( !is_single() && $post_type == array( TribeEvents::VENUE_POST_TYPE) ) { | |
add_filter( 'posts_fields', 'my_posts_fields_for_venues_function', 20, 1 ); | |
add_filter( 'posts_join', 'my_posts_join_for_venues_function', 20, 1 ); | |
add_filter( 'posts_where', 'my_posts_where_for_venues_function', 20, 1 ); |