Function Reference: geodir_detail_page_link_business_tab
Summary
This function has not been documented yet.
Source File
geodir_detail_page_link_business_tab() is located in geodir_event_manager/gdevents_hooks_actions.php [Line: 128]
Source Code
function geodir_detail_page_link_business_tab( $tabs_arr ) {
global $post, $wpdb, $plugin_prefix, $character_count, $gridview_columns, $gd_query_args;
$post_type = geodir_get_current_posttype();
$all_postypes = geodir_get_posttypes();
if ( !empty($post) && !empty($post->ID) && !empty( $tabs_arr ) && $post_type != 'gd_event' && in_array( $post_type, $all_postypes ) && ( geodir_is_page( 'detail' ) || geodir_is_page( 'preview' ) ) ) {
$old_character_count = $character_count;
$old_gridview_columns = $gridview_columns;
$old_gd_query_args = $gd_query_args;
$event_type = get_option( 'geodir_event_linked_event_type', 'all' );
$list_sort = get_option( 'geodir_event_linked_sortby', 'latest' );
$post_number = get_option( 'geodir_event_linked_count', '5' );
$gridview_columns = get_option( 'geodir_event_linked_listing_view', 'gridview_onehalf' );
$character_count = get_option( 'geodir_event_linked_post_excerpt', '20' );
if ( empty( $gd_query_args ) ) {
$gd_query_args = array();
}
$gd_query_args['is_geodir_loop'] = true;
$listing_ids = geodir_event_link_businesses( $post->ID, $post_type );
if ( !empty( $listing_ids ) ) {
$listings_data = geodir_event_link_businesses_data( $listing_ids, $event_type, $list_sort, $post_number );
if ( !empty( $listings_data ) ) {
$html = geodir_event_get_link_business( $listings_data );
if ( $html ) {
$post->link_business = '';
$tabs_arr['link_business'] = array(
'heading_text' => __( 'Events', GEODIREVENTS_TEXTDOMAIN ),
'is_active_tab' => false,
'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, 'link_business'),
'tab_content' => $html
);
}
}
}
global $character_count, $gridview_columns;
$old_gd_query_args = $gd_query_args;
$character_count = $old_character_count;
$gridview_columns = $old_gridview_columns;
}
return $tabs_arr;
}