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_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; |
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_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; | |
} |
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_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; | |
} |
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_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() ); |
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 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' ); |
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_filter( 'tribe_get_event_website_link_label', 'tribe_get_event_website_link_label_default' ); | |
function tribe_get_event_website_link_label_default( $label ) { | |
if ( $label === tribe_get_event_website_url() ) { | |
$label = "Visit Website »"; | |
} | |
return '<a href="' . tribe_get_event_website_url() . '" target="_blank">' . $label . '</a>'; | |
} |