Function Reference: geodir_event_postview_output
Summary
This function has not been documented yet.
Actions
‘geodir_before_view_all_link_in_widget’ [Line: 1266]
‘geodir_after_view_all_link_in_widget’ [Line: 1273]
Filters
‘widget_list_character_count’ [Line: 1210]
‘geodir_template_part-listing-listview’ [Line: 1315]
Source File
geodir_event_postview_output() is located in geodir_event_manager/gdevents_functions.php [Line: 1182]
Source Code
function geodir_event_postview_output($args='', $instance='') { // prints the widget extract($args, EXTR_SKIP); echo $before_widget; global $gdevents_widget; $gdevents_widget = true; $title = empty($instance['title']) ? ucwords($instance['category_title']) : apply_filters('widget_title', __($instance['title'],GEODIREVENTS_TEXTDOMAIN)); $post_type = 'gd_event'; $category = empty($instance['category']) ? '0' : apply_filters('widget_category', $instance['category']); $post_number = empty($instance['post_number']) ? '5' : apply_filters('widget_post_number', $instance['post_number']); $layout = empty($instance['layout']) ? 'gridview_onehalf' : apply_filters('widget_layout', $instance['layout']); $add_location_filter = empty($instance['add_location_filter']) ? '0' : apply_filters('widget_layout', $instance['add_location_filter']); $listing_width = empty($instance['listing_width']) ? '' : apply_filters('widget_layout', $instance['listing_width']); $list_sort = empty($instance['list_sort']) ? 'latest' : apply_filters('widget_list_sort', $instance['list_sort']); $list_filter = empty($instance['list_filter']) ? 'all' : apply_filters('widget_list_filter', $instance['list_filter']); if(isset($instance['character_count'])){$character_count = apply_filters('widget_list_character_count', $instance['character_count']);} else{$character_count ='';} $category = is_array($category) ? $category : explode(",", $category); if(empty($title) || $title == 'All' ){ $title .= ' '.get_post_type_plural_label($post_type); } $location_url = ''; $location_url = array(); $city = get_query_var('gd_city'); if( !empty($city) ){ if(get_option('geodir_show_location_url') == 'all'){ $country = get_query_var('gd_country'); $region = get_query_var('gd_region'); if(!empty($country)) $location_url[] = $country; if(!empty($region)) $location_url[] = $region; } $location_url[] = $city; } $location_url = implode("/",$location_url); $skip_location = false; if (!$add_location_filter && !empty($_SESSION['gd_multi_location'])) { $skip_location = true; unset($_SESSION['gd_multi_location']); } if ( get_option('permalink_structure') ) $viewall_url = get_post_type_archive_link($post_type); else $viewall_url = get_post_type_archive_link($post_type); if(!empty($category) && $category[0] != '0'){ global $geodir_add_location_url; $geodir_add_location_url = '0'; if($add_location_filter != '0'){ $geodir_add_location_url = '1'; } $viewall_url = get_term_link( (int)$category[0], $post_type.'category'); $geodir_add_location_url = NULL; } if ($skip_location) { $_SESSION['gd_multi_location'] = 1; } ?>$post_number, 'is_geodir_loop' => true, 'gd_location' => ($add_location_filter) ? true : false, 'post_type' => $post_type, 'geodir_event_listing_filter' => $list_filter, 'order_by' =>$list_sort, 'excerpt_length' => $character_count, ); if(!empty($category) && $category[0] != '0'){ $category_taxonomy = geodir_get_taxonomies($post_type); ######### WPML ######### if(function_exists('icl_object_id')) { $category = gd_lang_object_ids($category, $category_taxonomy[0]); } ######### WPML ######### $tax_query = array( 'taxonomy' => $category_taxonomy[0], 'field' => 'id', 'terms' => $category); $query_args['tax_query'] = array( $tax_query ); } global $gridview_columns; query_posts( $query_args ); if(strstr($layout,'gridview')){ $listing_view_exp = explode('_',$layout); $gridview_columns = $layout; $layout = $listing_view_exp[0]; } $template = apply_filters( "geodir_template_part-listing-listview", geodir_plugin_path() . '/geodirectory-templates/listing-listview.php' ); include( $template ); wp_reset_query(); ?>