Skip to content

Instantly share code, notes, and snippets.

Barry Hughes barryhughes

Block or report user

Report or block barryhughes

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@barryhughes
barryhughes / EventWebsiteLink.php
Last active Dec 11, 2015 — forked from theeventscalendar/Event Website link
Make an Event Website a link instead of showing the text url
View EventWebsiteLink.php
View WooCommerce-product-page.php
<?php
function wootix_no_hijack() {
if ( ! class_exists( 'Tribe__Events__Tickets__Woo__Main' ) ) return;
$woo_tickets = Tribe__Events__Tickets__Woo__Main::get_instance();
remove_filter( 'post_type_link', array( $woo_tickets, 'hijack_ticket_link' ), 10, 4 );
}
add_action( 'init', 'wootix_no_hijack' );
View gist:7693253
add_filter( 'tribe-events-bar-views', 'setup_listview_in_bar', 1, 1 );
add_filter( 'tribe-events-bar-views', 'setup_gridview_in_bar', 5, 1 );
function setup_listview_in_bar( $views ) {
$views[] = array( 'displaying' => 'upcoming', 'anchor' => 'List View', 'url' => tribe_get_listview_link() );
return $views;
}
function setup_gridview_in_bar( $views ) {
$views[] = array( 'displaying' => 'month', 'anchor' => 'Calendar', 'url' => tribe_get_gridview_link() );
View gist:7693244
add_filter( 'tribe-events-bar-views', 'my_setup_view_for_bar', 10);
function my_setup_view_for_bar( $views ) {
$tec = TribeEvents::instance();
$views[] = array('displaying' => 'myview', 'anchor' => 'My view', 'url' => $tec->getOption( 'eventsSlug', 'events' ) . '/my_view_slug' );
return $views;
}
View gist:7693226
add_filter( 'tribe_events_pre_get_posts', 'setup_my_bar_field_in_query', 10, 1 );
function setup_my_bar_field_in_query( $query ){
if ( !empty( $_REQUEST['tribe-bar-my-field'] ) ) {
$query->query_vars['my_var'] = $_REQUEST['tribe-bar-my-field'];
}
return $query;
}
View gist:7693185
add_filter( 'tribe-events-bar-filters', 'setup_my_field_in_bar', 1, 1 );
function setup_my_field_in_bar( $filters ) {
$filters['tribe-bar-my-field'] = array(
'name' => 'tribe-bar-my-field',
'caption' => 'My Field',
'html' => '<input type="text" name="tribe-bar-my-field" id="tribe-bar-my-field">'
);
return $filters;
You can’t perform that action at this time.