Send Geo Url Header only if use_geo_positions is set. Bug 242. Patch from 2fargon.
git-svn-id: https://develop.svn.wordpress.org/trunk@1584 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
a46419db4d
commit
1e61535580
@ -834,26 +834,28 @@ include_once (ABSPATH . WPINC . '/class-xmlrpcs.php');
|
||||
function doGeoUrlHeader($post_list = '') {
|
||||
global $posts;
|
||||
|
||||
if ($posts && 1 === count($posts) && ! empty($posts[0]->post_lat)) {
|
||||
// there's only one result see if it has a geo code
|
||||
$row = $posts[0];
|
||||
$lat = $row->post_lat;
|
||||
$lon = $row->post_lon;
|
||||
$title = $row->post_title;
|
||||
if(($lon != null) && ($lat != null) ) {
|
||||
echo "<meta name=\"ICBM\" content=\"".$lat.", ".$lon."\" />\n";
|
||||
echo "<meta name=\"DC.title\" content=\"".convert_chars(strip_tags(htmlspecialchars(get_bloginfo("name"))))." - ".$title."\" />\n";
|
||||
echo "<meta name=\"geo.position\" content=\"".$lat.";".$lon."\" />\n";
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if(get_settings('use_default_geourl')) {
|
||||
// send the default here
|
||||
echo "<meta name='ICBM' content=\"". get_settings('default_geourl_lat') .", ". get_settings('default_geourl_lon') ."\" />\n";
|
||||
echo "<meta name='DC.title' content=\"".convert_chars(strip_tags(htmlspecialchars(get_bloginfo("name"))))."\" />\n";
|
||||
echo "<meta name='geo.position' content=\"". get_settings('default_geourl_lat') .";". get_settings('default_geourl_lon') ."\" />\n";
|
||||
}
|
||||
}
|
||||
if (get_settings('use_geo_positions')) {
|
||||
if ($posts && 1 === count($posts) && ! empty($posts[0]->post_lat)) {
|
||||
// there's only one result see if it has a geo code
|
||||
$row = $posts[0];
|
||||
$lat = $row->post_lat;
|
||||
$lon = $row->post_lon;
|
||||
$title = $row->post_title;
|
||||
if(($lon != null) && ($lat != null) ) {
|
||||
echo "<meta name=\"ICBM\" content=\"".$lat.", ".$lon."\" />\n";
|
||||
echo "<meta name=\"DC.title\" content=\"".convert_chars(strip_tags(htmlspecialchars(get_bloginfo("name"))))." - ".$title."\" />\n";
|
||||
echo "<meta name=\"geo.position\" content=\"".$lat.";".$lon."\" />\n";
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if(get_settings('use_default_geourl')) {
|
||||
// send the default here
|
||||
echo "<meta name='ICBM' content=\"". get_settings('default_geourl_lat') .", ". get_settings('default_geourl_lon') ."\" />\n";
|
||||
echo "<meta name='DC.title' content=\"".convert_chars(strip_tags(htmlspecialchars(get_bloginfo("name"))))."\" />\n";
|
||||
echo "<meta name='geo.position' content=\"". get_settings('default_geourl_lat') .";". get_settings('default_geourl_lon') ."\" />\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getRemoteFile($host,$path) {
|
||||
|
Loading…
Reference in New Issue
Block a user