Example #1
0
/**
 * Generates a map of locations that match given query attributes. Accepts any location query attributes. 
 * @param unknown_type $atts
 * @return string
 */
function em_get_locations_map_shortcode($atts)
{
    $clean_atts = EM_Locations::get_default_search($atts);
    $clean_atts['width'] = !empty($atts['width']) ? $atts['width'] : 450;
    $clean_atts['height'] = !empty($atts['height']) ? $atts['height'] : 300;
    return EM_Map::get_global($atts);
}
Example #2
0
/**
 * Returns a html list of locations filtered by the array or query-string of arguments supplied. 
 * @param array|string $args
 * @return string
 */
function em_get_locations($args = array())
{
    if (strpos($args, "=")) {
        // allows the use of arguments without breaking the legacy code
        $defaults = EM_Locations::get_default_search();
        $args = wp_parse_args($args, $defaults);
    }
    return EM_Locations::output($args);
}
Example #3
0
/**
 * Generates a map of locations that match given query attributes. Accepts any location query attributes. 
 * @param unknown_type $atts
 * @return string
 */
function em_get_locations_map_shortcode($atts)
{
    $clean_atts = EM_Locations::get_default_search($atts);
    $clean_atts['width'] = !empty($atts['width']) ? $atts['width'] : 450;
    $clean_atts['height'] = !empty($atts['height']) ? $atts['height'] : 300;
    ob_start();
    em_locate_template('templates/map-global.php', true, array('args' => $atts));
    return ob_get_clean();
}