Function Reference: geodir_sc_popular_location

Global Values

$wp
(object) (required) WordPress object.

Default: None

Parameters

($atts) (required)

Default: None

Return Values

(string)

    Source File

    geodir_sc_popular_location() is located in geodir_location_manager/geodir_location_shortcodes.php [Line: 208]

    Source Code

    function geodir_sc_popular_location( $atts ) {
    	global $wp;
    
    	$location_terms = geodir_get_current_location_terms(); //locations in sessions
    
    	// get all the cities in current region
    	$args = array(
    		'what'                     => 'city',
    		'city_val'                 => '',
    		'region_val'               => '',
    		'country_val'              => '',
    		'country_non_restricted'   => '',
    		'region_non_restricted'    => '',
    		'city_non_restricted'      => '',
    		'filter_by_non_restricted' => true,
    		'compare_operator'         => 'like',
    		'country_column_name'      => 'country_slug',
    		'region_column_name'       => 'region_slug',
    		'city_column_name'         => 'city_slug',
    		'location_link_part'       => true,
    		'order_by'                 => ' asc ',
    		'no_of_records'            => '',
    		'format'                   => array(
    			'type'                   => 'list',
    			'container_wrapper'      => 'ul',
    			'container_wrapper_attr' => '',
    			'item_wrapper'           => 'li',
    			'item_wrapper_attr'      => ''
    		)
    	);
    	if ( ! empty( $location_terms ) ) {
    
    		if ( isset( $location_terms['gd_region'] ) && $location_terms['gd_region'] != '' ) {
    			$args['region_val']  = $location_terms['gd_region'];
    			$args['country_val'] = $location_terms['gd_country'];
    		} else if ( isset( $location_terms['gd_country'] ) && $location_terms['gd_country'] != '' ) {
    			$args['country_val'] = $location_terms['gd_country'];
    		}
    	}
    	ob_start();
    	echo '';
    	$output = ob_get_contents();
    	ob_end_clean();
    	return $output;
    
    }