Properties

$add_loader_script

$add_loader_script : 

Whether to add the click-to-load map script.

Type

$deactivate_geo_search_basename

$deactivate_geo_search_basename : 

The basename of the Geo Mashup Search plugin when deactivated.

Type

Methods

load()

load()

Load Geo Mashup.

Initializations that can be done before init().

is_options_page()

is_options_page() : boolean

Test to see if the current request is for the Geo Mashup options page.

Returns

boolean —

Whether this is a an options page request.

init()

init()

WordPress init action.

init action, called by WordPress.

activation_hook()

activation_hook()

WordPress hook to perform activation tasks.

dependent_init()

dependent_init()

WordPress action to supply an init action for plugins that would like to use Geo Mashup APIs.

action_wp_scheduled_delete()

action_wp_scheduled_delete()

WordPress action to remove expired Geo Mashup transients.

register_script()

register_script(string $handle, string $src, array $deps, string|boolean $ver, boolean $in_footer)

Register the Geo Mashup script appropriate for the request.

Parameters

string $handle

Global tag for the script.

string $src

Path to the script from the root directory of Geo Mashup.

array $deps

Array of dependency handles.

string|boolean $ver

Script version.

boolean $in_footer

Whether the script can be loaded in the footer.

register_style()

register_style(string $handle, string $src, array $deps, string|boolean $ver, string $media)

Register the Geo Mashup style appropriate for the request.

Parameters

string $handle

Global tag for the style.

string $src

Path to the stylesheet from the root directory of Geo Mashup.

array $deps

Array of dependency handles.

string|boolean $ver

Script version.

string $media

Stylesheet media target.

wp_footer()

wp_footer()

WordPress action to add things like scripts to the footer.

query_vars()

query_vars( $public_query_vars)

WordPress filter to add Geo Mashup query variables.

Parameters

$public_query_vars

locate_template()

locate_template(string $template_base) : string

Locate a Geo Mashup template.

Geo Mashup looks for templates given a certain base name. Given a base name of 'info-window', it will return the first of:

'geo-mashup-info-window.php' in the active theme directory
'info-window.php' in the geo-mashup-custom plugin directory
'default-templates/info-window.php' in the geo-mashup plugin directory

Parameters

string $template_base

The base name of the template.

Returns

string —

The file path of the template found.

template_redirect()

template_redirect()

WordPress action to deliver templated Geo Mashup content.

geo_query()

geo_query()

Process an AJAX geo query.

ajax_edit()

ajax_edit()

WordPress action to perform an ajax edit operation and echo results.

join_post_queries()

join_post_queries(boolean $yes_or_no)

Toggle limiting of query_posts to located posts only, with Geo Mashup query extensions.

When enabled, only posts with locations will be returned from WordPress query_posts() and related functions. Also adds Geo Mashup public query variables.

Caution - what if a future Geo Mashup incorporates multiple locations per object?

Parameters

boolean $yes_or_no

Whether to activate the join or not.

explode_assoc()

explode_assoc(string $glue1, string $glue2, string $str) : array

Helper to turn a string of key-value pairs into an associative array.

Parameters

string $glue1

Pair separator.

string $glue2

Key/value separator.

string $str

String to explode.

Returns

array —

The associative array.

implode_assoc()

implode_assoc(string $inner_glue, string $outer_glue, array $array, mixed $skip_empty, mixed $urlencoded) : string

Helper to turn an associative array into a string of key-value pairs.

Parameters

string $inner_glue

Key/value separator.

string $outer_glue

Pair separator.

array $array

Array to implode.

mixed $skip_empty

Whether to include empty values in output.

mixed $urlencoded

Whether to URL encode the output.

Returns

string —

The imploded string.

get_language_code()

get_language_code() : string

Guess the best language code for the current context.

Takes some plugins and common practices into account.

Returns

string —

Language code.

get_searchable_post_types()

get_searchable_post_types() : array

Get post types available for location searches.

This includes post types included via the located_post_types option, as well as post types registered with exclude_from_search set to false.

Returns

array —

Array of post type strings.

get_kml_attachment_urls()

get_kml_attachment_urls(integer $post_id) : array

Get an array of URLs of KML or KMZ attachments for a post.

Parameters

integer $post_id

Returns

array —

Array of URL strings.

ajax_kml_attachments()

ajax_kml_attachments()

Echo a JSONP array of URLs of KML or KMZ attachments for posts.

since 1.4

wp_head()

wp_head()

WordPress action to add relevant geo meta tags to the document head.

wp_head action, called by WordPress.

get_locations_json()

get_locations_json(string|array $query_args, string $format) : string

Query object locations and return JSON.

Offers customization per object location via a filter, geo_mashup_locations_json_object.

Parameters

string|array $query_args

Query variables for GeoMashupDB::get_object_locations().

string $format

(optional) 'JSON' (default) or ARRAY_A

Returns

string —

Queried object locations JSON ( { "object" : [...] } ).

build_map_data()

build_map_data(array $query) : array

Build the data for a javascript map.

Parameters are used both to retrieve data and as options to eventually pass to the javascript.

Parameters

array $query

Query parameters

Returns

array —

Map data ready to be rendered.

build_home_url()

build_home_url(array $query) : string

Make an URL with querystring added to the site's home URL.

Parameters

array $query

Associative array of querystring parameters.

Returns

string —

HTML-ready URL.

map()

map(string|array $atts) : string

The map template tag.

Returns HTML for a Google map. Must use with echo in a template: echo GeoMashup::map();.

Parameters

string|array $atts

Template tag parameters.

Returns

string —

The HTML for the requested map.

full_post()

full_post(string|array $args) : string

Full post template tag.

Returns a placeholder where a related map should display the full post content of the currently selected marker.

Parameters

string|array $args

Template tag arguments.

Returns

string —

Placeholder HTML.

category_name()

category_name(string|array $option_args) : string

Category name template tag.

If there is a map_cat parameter, return the name of that category.

Parameters

string|array $option_args

Template tag arguments.

Returns

string —

Category name.

term_legend()

term_legend(string|array $args) : string

Term legend template tag.

Returns a placeholder where a related map should display a legend for the terms of the displayed content.

Parameters

string|array $args

Template tag arguments.

Returns

string —

Placeholder HTML.

category_legend()

category_legend(string|array $args) : string

Category (term) legend template tag.

Returns a placeholder where a related map should display a legend for the terms of the displayed content. Used to display only categories, now displays all included terms.

Parameters

string|array $args

Template tag arguments.

Returns

string —

Placeholder HTML.

list_cats()

list_cats( $content,  $category)

If the option is set, add a map link to category lists.

list_cats filter called by WordPress.

Parameters

$content
$category

admin_menu()

admin_menu()

WordPress action to add the Geo Mashup Options settings admin page.

admin_menu action called by WordPress.

admin_notices()

admin_notices()

WordPress action to display important messages in the admin.

admin_notices action called by WordPress.

plugin_action_links()

plugin_action_links( $links,  $file)

WordPress action to add custom action links to the plugin listing.

plugin_action_links filter, called by WordPress.

Parameters

$links
$file

plugin_row_meta()

plugin_row_meta( $links,  $file)

WordPress action to add custom meta links to the plugin listing.

plugin_row_meta filter, called by WordPress.

Parameters

$links
$file

options_page()

options_page()

WordPress action to produce the Geo Mashup Options admin page.

Called by the WordPress admin.

current_location()

current_location(string $output, string $object_name) : object|boolean

Get the location of the current loop object, if any.

Does not work in non-global loops, such as are made with WP_Query.

Parameters

string $output

ARRAY_A | ARRAY_N | OBJECT

string $object_name

Kind of object we're looking for, 'post', 'user', 'comment'.

Returns

object|boolean —

Location object or false if none.

current_location_guess()

current_location_guess(string $output, string $object_name) : object|boolean

Look at global loops first, then try to guess a current location if needed.

Parameters

string $output

ARRAY_A | ARRAY_N | OBJECT

string $object_name

Kind of object we're looking for, 'post', 'user', 'comment'.

Returns

object|boolean —

Location object or false if none.

location_info()

location_info(string|array $args) : string

A template tag to insert location information.

Parameters

string|array $args

Template tag arguments.

Returns

string —

The information requested, empty string if none.

post_link()

post_link( $option_args)

A template tag to insert a link to a post on the mashup.

Parameters

$option_args

show_on_map_link_url()

show_on_map_link_url(string|array $args) : string

A template tag to return an URL for the current location on the global map page.

Parameters

string|array $args

Template tag arguments.

Returns

string —

The URL, empty if no current location is found.

show_on_map_link()

show_on_map_link(string|array $args) : string

A template tag to insert a link to the current location post on the global map page.

Parameters

string|array $args

Tag arguments.

Returns

string —

The link HTML, empty if no current location is found.

visible_posts_list()

visible_posts_list(string|array $args) : string

Visible posts list template tag.

Returns a placeholder where a related map should display a list of the currently visible posts.

Parameters

string|array $args

Template tag arguments.

Returns

string —

Placeholder HTML.

list_located_posts()

list_located_posts(string|array $option_args) : string

List located posts template tag.

Returns an HTML list of all located posts.

Parameters

string|array $option_args

Template tag arguments.

Returns

string —

List HTML.

list_located_posts_by_area()

list_located_posts_by_area(string|array $args) : string

List located posts by area template tag.

Returns an HTML list of all located posts by country and state. May try to look up this information when absent.

Parameters

string|array $args

Template tag arguments.

Returns

string —

List HTML.

nearby_list()

nearby_list(string|array $args) : string

List nearby items.

Returns an HTML list of objects near the current reference, the current post by default.

Parameters

string|array $args

Template tag arguments.

Returns

string —

List HTML.

post_coordinates()

post_coordinates(integer $places) : array

Post coordinates template tag.

Get the coordinates of the current post.

Parameters

integer $places

Maximum number of decimal places to use.

Returns

array —

Array containing 'lat' and 'lng' keys.

rss_ns()

rss_ns()

WordPress action to emit GeoRSS namespace.

rss_ns action called by WordPress.

rss_item()

rss_item()

WordPress action to emit GeoRSS tags.

rss_item action called by WordPress.

tabbed_category_index()

tabbed_category_index(string|array $args) : string

Tabbed category index template tag.

Returns a placeholder where a related map should display a list of map objects by category, organized into HTML suited for presentation as tabs.

Parameters

string|array $args

Template tag arguments.

Returns

string —

Placeholder HTML.

tabbed_term_index()

tabbed_term_index( $args)

Tabbed term index template tag.

Parameters

$args

load_dependencies()

load_dependencies()

Load relevant dependencies.

load_hooks()

load_hooks()

Load relevant hooks.

load_constants()

load_constants()

Define Geo Mashup constants.

load_scripts()

load_scripts()

Load relevant scripts.

load_styles()

load_styles()

Load relevant styles.

render_map()

render_map()

Process an iframe map request.

convert_map_attributes()

convert_map_attributes(array $atts)

Convert deprecated attribute names.

Parameters

array $atts

Attributes to modify.

augment_map_object_location()

augment_map_object_location(string $object_name, object $object_location) : array

Augment an object location for display.

Adds term data, object type, author, and label.

Parameters

string $object_name

The object type, e.g. 'post', 'user', etc.

object $object_location

The object location data.

Returns

array —

The augmented object location data.