diff --git a/wp-includes/functions.php b/wp-includes/functions.php index d9be6696eb..782f1d09d1 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -867,10 +867,16 @@ function pingback($content, $post_ID) { debug_fclose($log); } -function doGeoUrlHeader($posts) { - if (count($posts) == 1) { +function doGeoUrlHeader($post_list = '') { + global $posts; + + if (empty($post_list)) { + $post_list = $posts; + } + + if (count($post_list) == 1) { // there's only one result see if it has a geo code - $row = $posts[0]; + $row = $post_list[0]; $lat = $row->post_lat; $lon = $row->post_lon; $title = $row->post_title; diff --git a/wp-includes/template-functions-geo.php b/wp-includes/template-functions-geo.php index f3f93143b4..aa799b0679 100644 --- a/wp-includes/template-functions-geo.php +++ b/wp-includes/template-functions-geo.php @@ -1,12 +1,26 @@ post_lat; + + if ($post->post_lat != '') { + return $post->post_lat; + } else if(get_settings('use_default_geourl')) { + return get_settings('default_geourl_lat'); + } + + return ''; } function get_Lon() { global $post; - return $post->post_lon; + + if ($post->post_lon != '') { + return $post->post_lon; + } else if(get_settings('use_default_geourl')) { + return get_settings('default_geourl_lon'); + } + + return ''; } function print_Lat() { diff --git a/wp-includes/vars.php b/wp-includes/vars.php index 579f60301b..0acb1d5dbe 100644 --- a/wp-includes/vars.php +++ b/wp-includes/vars.php @@ -182,5 +182,5 @@ add_filter('single_post_title', 'wptexturize'); add_filter('the_title', 'wptexturize'); add_filter('the_content', 'wptexturize'); add_filter('the_excerpt', 'wptexturize'); - +add_action('wp_head', 'doGeoUrlHeader'); ?> \ No newline at end of file