Created
March 8, 2017 05:59
-
-
Save kprajapatii/02be2d46a6b1b1740d511f7dedb778d6 to your computer and use it in GitHub Desktop.
GeoDirectory: Display event schedule as a tab on event detail page.
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 | |
/* START */ | |
// GeoDirectory: Display event schedule as a tab on event detail page. | |
function gd_show_event_schedule_as_tab( $template ) { | |
if ( has_filter( 'geodir_detail_page_sidebar_content', 'geodir_event_detail_page_sitebar_content' ) ) { | |
remove_filter( 'geodir_detail_page_sidebar_content', 'geodir_event_detail_page_sitebar_content', 2 ); | |
add_filter( 'geodir_detail_page_tab_list_extend', 'gd_detail_page_tab_event_schedule', 10, 1 ); | |
add_action( 'geodir_after_tab_content', 'gd_detail_page_tab_content_event_schedule', 10, 1 ); | |
} | |
return $template; | |
} | |
add_filter( 'template_include', 'gd_show_event_schedule_as_tab', 10 ); | |
function gd_detail_page_tab_event_schedule( $tab_array ) { | |
if ( 'gd_event' == get_post_type() ) { | |
$tab_array['event_schedule'] = array( | |
'heading_text' => __( 'Event Schedule', 'geodirevents' ), | |
'is_active_tab' => false, | |
'is_display' => apply_filters( 'geodir_detail_page_tab_is_display', true, 'event_schedule' ), | |
'tab_content' => '' | |
); | |
} | |
return $tab_array ; | |
} | |
function gd_detail_page_tab_content_event_schedule( $tab ) { | |
if ( $tab == 'event_schedule' ) { | |
geodir_event_show_shedule_date(); | |
} | |
} | |
/* END */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment