Class: GeoMashupDB
Source Location: /geo-mashup-db.php
  
 
Static class to provide a namespace for Geo Mashup data functions. 
  
Author(s):
    
        
 | 
 | 
 | 
  
 
 
Class Details
  
 
 
Class Variables
 
 
Class Methods
   
	
	static method action_added_comment_meta [line 137]
	
    
    
		static void action_added_comment_meta(
$meta_id, 
$comment_id, 
$meta_key, 
$meta_value)
     |   
     |  
 
	
		WordPress action to update Geo Mashup comment location when geodata custom fields are updated.
 Tags:
	
        Parameters:
    
        
   
   
	
	static method action_added_post_meta [line 119]
	
    
    
		static void action_added_post_meta(
$meta_id, 
$post_id, 
$meta_key, 
$meta_value)
     |   
     |  
 
	
		WordPress action to update Geo Mashup post location when geodata custom fields are updated.
 Tags:
	
        Parameters:
    
        
   
   
	
	static method action_added_user_meta [line 128]
	
    
    
		static void action_added_user_meta(
$meta_id, 
$user_id, 
$meta_key, 
$meta_value)
     |   
     |  
 
	
		WordPress action to update Geo Mashup user location when geodata custom fields are updated.
 Tags:
	
        Parameters:
    
        
   
   
	
	static method activation_log [line 596]
	
    
    
		static string activation_log(
[string
$message = null], [boolean
$write = false])
     |   
     |  
 
	
		Append to the activation log. Add a message and optionally write the activation log.  Needs to be written before the end of the request or it will not be saved. 
Tags:
	
        Parameters:
    
        
   
   
	
	static method add_geodata_sync_hooks [line 73]
	
    
    
		static void add_geodata_sync_hooks(
)
     |   
     |  
 
	
		Add hooks to synchronize Geo Mashup ojbect locations with WordPress geodata.
 Tags:
	
        
   
   
	
	static method are_any_location_fields_empty [line 829]
	
    
    
		static bool are_any_location_fields_empty(
array
$location, [array
$fields = null])
     |   
     |  
 
	
		Check a location for empty fields.
 Tags:
	
        Parameters:
    
        
   
   
	
	static method blank_location [line 1232]
	
    
    
		static array|object Empty blank_location(
[string
$format = OBJECT])
     |   
     |  
 
	
		Get a blank location. Used to return object fields too - use blank_object_location for that if desired. 
Tags:
	
        Parameters:
    
        
   
   
	
	static method blank_object_location [line 1258]
	
    
    
		static array|object Empty blank_object_location(
[string
$format = OBJECT])
     |   
     |  
 
	
		Get a blank object location.
 Tags:
	
        Parameters:
    
        
   
   
	
	static method bulk_reverse_geocode [line 932]
	
    
    
		static string bulk_reverse_geocode(
)
     |   
     |  
 
	
		Try to reverse-geocode all locations with relevant missing data. Used by the options page. Tries to comply with the PHP maximum execution  time, and delay requests if Google sends a 604. 
Tags:
	
        
   
   
	
	static method cache_administrative_name [line 1000]
	
    
    
		static int cache_administrative_name(
string
$country_code, string
$admin_code, string
$isolanguage, string
$name, [string
$geoname_id = null])
     |   
     |  
 
	
		Store an administrative name in the database to prevent future web service lookups.
 Tags:
	
        Parameters:
    
        
   
   
	
	static method category_located_post_count [line 1906]
	
    
    
		static int category_located_post_count(
id
$category_id)
     |   
     |  
 
	
		Get the number of located posts in a category.
 Tags:
	
        Parameters:
    
        
   
   
	
	static method copy_to_geodata [line 266]
	
    
    
		static void copy_to_geodata(
string
$meta_type, int
$object_id, 
$geo_date, 
$location_id, array
$location)
     |   
     |  
 
	
		Update object geodata if needed.
 Tags:
	
        Parameters:
    
        
   
   
	
	static method delete_comment [line 2000]
	
    
    
		static void delete_comment(
$id)
     |   
     |  
 
	
		When a comment is deleted, remove location relationships for it. delete_comment action  called by WordPress. 
Tags:
	
        Parameters:
    
        
   
   
	
	static method delete_location [line 1864]
	
    
    
		static int|WP_Error delete_location(
id|array
$ids)
     |   
     |  
 
	
		Delete a location or locations.
 Tags:
	
        Parameters:
    
        
   
   
	
	static method delete_object_location [line 1835]
	
    
    
		static int|WP_Error delete_object_location(
string
$object_name, id|array
$object_ids)
     |   
     |  
 
	
		Delete an object location or locations. This removes the association of an object with a location, but does NOT  delete the location. 
Tags:
	
        Parameters:
    
        
   
   
	
	static method delete_post [line 1988]
	
    
    
		static void delete_post(
$id)
     |   
     |  
 
	
		When a post is deleted, remove location relationships for it. delete_post action  called by WordPress. 
Tags:
	
        Parameters:
    
        
   
   
	
	static method delete_user [line 2012]
	
    
    
		static void delete_user(
$id)
     |   
     |  
 
	
		When a user is deleted, remove location relationships for it. delete_user action  called by WordPress. 
Tags:
	
        Parameters:
    
        
   
   
	
	static method duplicate_geodata [line 1021]
	
    
    
		static bool duplicate_geodata(
)
     |   
     |  
 
	
		Copy missing geo data to and from the standard location (http://codex.wordpress.org/Geodata)  for posts, users, and comments.
 Tags:
	
        
   
   
	
	static method filter_update_comment_metadata [line 175]
	
    
    
		static void filter_update_comment_metadata(
$ok, 
$object_id, 
$meta_key, 
$meta_value, 
$prev_value)
     |   
     |  
 
	
		WordPress filter to prevent updates to geodata fields we've already updated.
 Tags:
	
        Parameters:
    
        
   
   
	
	static method filter_update_post_metadata [line 146]
	
    
    
		static void filter_update_post_metadata(
$ok, 
$object_id, 
$meta_key, 
$meta_value, 
$prev_value)
     |   
     |  
 
	
		WordPress filter to prevent updates to geodata fields we've already updated.
 Tags:
	
        Parameters:
    
        
   
   
	
	static method filter_update_user_metadata [line 160]
	
    
    
		static void filter_update_user_metadata(
$ok, 
$object_id, 
$meta_key, 
$meta_value, 
$prev_value)
     |   
     |  
 
	
		WordPress filter to prevent updates to geodata fields we've already updated.
 Tags:
	
        Parameters:
    
        
   
   
	
	static method geocode [line 781]
	
    
    
		static bool geocode(
mixed
$query, 
&$location, [string
$language = ''], array
$location)
     |   
     |  
 
	
		Try to fill in coordinates and other fields of a location from a textual  location search. Multiple geocoding services may be used. Google services are only used  if the default map provider is Google. 
Tags:
	
        Parameters:
    
        
   
   
	
	static method get_comment_in [line 1945]
	
    
    
		static array get_comment_in(
$args)
     |   
     |  
 
	
		Get multiple comments. What is the WordPress way? Expect deprecation. 
Tags:
	
        Parameters:
    
        
   
   
	
	static method get_distinct_located_values [line 1289]
	
    
    
		static object WP_DB get_distinct_located_values(
string
$names, [array
$where = null])
     |   
     |  
 
	
		Get distinct values of one or more object location fields. Can be used to get a list of countries with locations, for example. 
Tags:
	
        Parameters:
    
        
   
   
	
	static method get_location [line 1397]
	
    
    
		static object|array get_location(
int
$location_id, [string
$output = OBJECT])
     |   
     |  
 
	
		Get a location by ID.
 Tags:
	
        Parameters:
    
        
   
   
	
	static method get_object_location [line 1368]
	
    
    
		static object|array get_object_location(
string
$object_name, id
$object_id, [string
$output = OBJECT])
     |   
     |  
 
	
		Get the location of an object.
 Tags:
	
        Parameters:
    
        
   
   
	
	static method get_object_locations [line 1440]
	
    
    
		static array get_object_locations(
[string
$query_args = ''])
     |   
     |  
 
	
		Get locations of objects. 
     'object_name' => 'user',  
     'map_cat' => '3,4,8',  
     'minlat' => 30,  
     'maxlat' => 40,  
     'minlon' => -106,  
     'maxlat' => -103 )  
 );  
 
Tags:
	
        Parameters:
    
        
   
   
	
	static method get_post_location [line 1329]
	
    
    
		static object Post get_post_location(
id
$post_id)
     |   
     |  
 
	
		Get the location of a post.
 Tags:
	
        Parameters:
    
        
   
   
	
	static method get_post_locations [line 1417]
	
    
    
		static array get_post_locations(
[string
$query_args = ''])
     |   
     |  
 
	
		Get locations of posts.
 Tags:
	
        Parameters:
    
        
   
   
	
	static method get_saved_locations [line 1887]
	
    
    
		static array|WP_Error get_saved_locations(
)
     |   
     |  
 
	
		Get locations with saved names.
 Tags:
	
        
   
   
	
	static method get_user_in [line 1966]
	
    
    
		static array get_user_in(
$args)
     |   
     |  
 
	
		Get multiple users. What is the WordPress way? Expect deprecation. 
Tags:
	
        Parameters:
    
        
   
   
	
	static method init [line 52]
	
    
	
		WordPress action to set up data-related WordPress hooks.
 Tags:
	
        
   
   
	
	static method install [line 617]
	
    
	
		Install or update Geo Mashup tables.
 Tags:
	
        
   
   
	
	static method installed_version [line 307]
	
    
    
		static string installed_version(
string
$new_version)
     |   
     |  
 
	
		Get the installed database version.
 Tags:
	
        Parameters:
    
        
   
   
	
	static method join_post_queries [line 378]
	
    
    
		static bool join_post_queries(
[bool
$new_value = null])
     |   
     |  
 
	
		Toggle joining of WordPress queries with Geo Mashup tables. Use the public wrapper GeoMashup::join_post_queries() 
Tags:
	
        Parameters:
    
        
   
   
	
	static method object_storage [line 335]
	
    
    
		static array|bool object_storage(
string
$object_name, [array
$new_storage = null])
     |   
     |  
 
	
		Get or set storage information for an object name. Potentially you could add storage information for a new kind of object:   
     'table' => $wpdb->prefix . 'foos',  
     'id_column' => 'foo_id',  
     'label_column' => 'foo_display_name',  
     'sort' => 'foo_order ASC' )  
 );  
   Would add the necessary information for a custom table of foo objects.
 Tags:
	
        Parameters:
    
        
   
   
	
	static method parse_query [line 451]
	
    
    
		static void parse_query(
$query)
     |   
     |  
 
	
		WordPress action to capture custom orderby field before it is removed. parse_query action  called by WordPress. 
Tags:
	
        Parameters:
    
        
   
   
	
	static method posts_fields [line 493]
	
    
    
		static void posts_fields(
$fields)
     |   
     |  
 
	
		WordPress filter to add Geo Mashup fields to WordPress post queries. posts_fields filter  called by WordPress. 
Tags:
	
        Parameters:
    
        
   
   
	
	static method posts_join [line 510]
	
    
    
		static void posts_join(
$join)
     |   
     |  
 
	
		WordPress filter to join Geo Mashup tables to WordPress post queries. posts_join filter  called by WordPress. 
Tags:
	
        Parameters:
    
        
   
   
	
	static method posts_orderby [line 570]
	
    
    
		static void posts_orderby(
$orderby)
     |   
     |  
 
	
		WordPress filter to replace a WordPress post query orderby with a requested Geo Mashup field. posts_orderby filter  called by WordPress. 
Tags:
	
        Parameters:
    
        
   
   
	
	static method posts_where [line 529]
	
    
    
		static void posts_where(
$where)
     |   
     |  
 
	
		WordPress filter to incorporate geo mashup query vars in WordPress post queries. posts_where filter  called by WordPress. 
Tags:
	
        Parameters:
    
        
   
   
	
	static method post_meta_key_suggest [line 2021]
	
    
    
		static void post_meta_key_suggest(
)
     |   
     |  
 
	
		Geo Mashup action to echo post meta keys that match a jQuery suggest query.
 Tags:
	
        
   
   
	
	static method primary_language_code [line 753]
	
    
    
		static string primary_language_code(
[string
$language = null])
     |   
     |  
 
	
		Trim a locale or browser accepted languages string down to the 2 or 3 character  primary language code.
 Tags:
	
        Parameters:
    
        
   
   
	
	static method query_vars [line 414]
	
    
    
		static void query_vars(
$public_query_vars)
     |   
     |  
 
	
		WordPress filter to add Geo Mashup public query variables. query_vars filter  called by Wordpress. 
Tags:
	
        Parameters:
    
        
   
   
	
	static method remove_geodata_sync_hooks [line 96]
	
    
    
		static void remove_geodata_sync_hooks(
)
     |   
     |  
 
	
		Remove hooks to synchronize Geo Mashup ojbect locations with WordPress geodata.
 Tags:
	
        
   
   
	
	static method set_location [line 1712]
	
    
    
		static id|WP_Error set_location(
&$location, [bool
$do_lookups = null], array
$location)
     |   
     |  
 
	
		Save a location. This can create a new location or update an existing one. If a location exists within 5 decimal  places of the passed in coordinates, it will be updated. If the saved_name of a different location  is given, it will be removed from the other location and saved with this one. Blank fields will not  replace existing data. 
Tags:
	
        Parameters:
    
        
   
   
	
	static method set_object_location [line 1646]
	
    
    
		static id|WP_Error set_object_location(
string
$object_name, id
$object_id, id|array
$location, [bool
$do_lookups = null], [string
$geo_date = ''])
     |   
     |  
 
	
		Save an object location in the database. Object data is saved in the geo_mashup_location_relationships table, and  location data is saved in geo_mashup_locations. 
Tags:
	
        Parameters:
    
        
   
   
	
	method get_administrative_name [line 707]
	
    
    
		string|null get_administrative_name(
string
$country_code, [string
$admin_code = null], [string
$language = ''])
     |   
     |  
 
	
		Try to get a language-sensitive place administrative name. First look in the names cached in the database, then query geonames.org for it.  If a name can't be found for the requested language, a default name is returned,  usually in the local language. If nothing can be found, returns NULL. 
Tags:
	
        Parameters:
    
        
   
  
        
       |   
     |