1. Startseite
  2. Wissensdatenbank
  3. Personalisierung
  4. Ändern von Standortdaten vor dem Rendern (Karten- und Listenansicht, z. B. Anpassen des Markersymbols)

Ändern von Standortdaten vor dem Rendern (Karten- und Listenansicht, z. B. Anpassen des Markersymbols)

Sie können die Daten für jeden Ort anpassen, bevor er auf der Karte oder in der Liste angezeigt wird. Dies kann nützlich sein, wenn Sie bestimmte Markierungssymbole für bestimmte Orte anzeigen möchten.

PHP
add_filter('oum_location_data', function ( $location_data, $post_id ) {

  // Example: Change marker icon based on custom logic
  if ( $post_id == 123 ) {
    $location_data['icon'] = 'https://example.com/custom-marker.png';
  }

  // You can modify any property of $location_data:
  // - icon: marker icon URL (works for map markers and list view)
  // - title, lat, lng, zoom, types, post_id, address, text, image, audio, video, custom_fields, votes, etc.
  // - content: plain text for the map marker search only (not the popup HTML). Full bubble markup is built
  //   on the server and can be changed with the oum_location_bubble_content filter (or oum_location_bubble_image).

  return $location_data;
}, 10, 2);
War dieser Artikel hilfreich?

Verwandte Artikel

Brauchen Sie Unterstützung?

Sie können die gesuchte Antwort nicht finden&#039?
Kontakt zum Support

DE