Make WordPress Core

Changeset 1179


Ignore:
Timestamp:
04/26/2004 02:34:07 AM (21 years ago)
Author:
rboren
Message:

Geo enhancements. Allow get_Lat and get_Lon to be called outside of the post loop. Add doGeoUrlHeader as an action on wp_head.

Location:
trunk/wp-includes
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/functions.php

    r1150 r1179  
    868868}
    869869
    870 function doGeoUrlHeader($posts) {
    871     if (count($posts) == 1) {
     870function doGeoUrlHeader($post_list = '') {
     871    global $posts;
     872
     873    if (empty($post_list)) {
     874        $post_list = $posts;
     875    }
     876
     877    if (count($post_list) == 1) {
    872878        // there's only one result  see if it has a geo code
    873         $row = $posts[0];
     879        $row = $post_list[0];
    874880        $lat = $row->post_lat;
    875881        $lon = $row->post_lon;
  • trunk/wp-includes/template-functions-geo.php

    r1088 r1179  
    22function get_Lat() {
    33    global $post;
    4     return $post->post_lat;
     4
     5   if ($post->post_lat != '') {
     6       return $post->post_lat;
     7   } else if(get_settings('use_default_geourl')) {
     8       return get_settings('default_geourl_lat');
     9   }
     10
     11   return '';
    512}
    613
    714function get_Lon() {
    815    global $post;
    9     return $post->post_lon;
     16
     17   if ($post->post_lon != '') {
     18       return $post->post_lon;
     19   } else if(get_settings('use_default_geourl')) {
     20       return get_settings('default_geourl_lon');
     21   }
     22
     23   return '';
    1024}
    1125
  • trunk/wp-includes/vars.php

    r1148 r1179  
    183183add_filter('the_content', 'wptexturize');
    184184add_filter('the_excerpt', 'wptexturize');
    185 
     185add_action('wp_head', 'doGeoUrlHeader');
    186186?>
Note: See TracChangeset for help on using the changeset viewer.