You are here

function leaflet_token_replace in Leaflet 7

Replaces all tokens in a given string with appropriate values.

This is a wrapper arround token_replace, to apply token_replace only to strings.

1 string reference to 'leaflet_token_replace'
leaflet_apply_map_settings in ./leaflet.formatters.inc
Universal method for applying map settings from leaflet_form_elements items.

File

./leaflet.formatters.inc, line 476
Leaflet field formatter functions.

Code

function leaflet_token_replace(&$subject, $key, $data = array()) {
  if (is_string($subject) && $subject) {
    $subject = token_replace($subject, $data['data'], $data['options']);
  }
}