{"id":6738,"date":"2026-05-04T14:12:33","date_gmt":"2026-05-04T12:12:33","guid":{"rendered":"https:\/\/www.open-user-map.com\/?post_type=ht_kb&#038;p=6738"},"modified":"2026-05-04T14:12:34","modified_gmt":"2026-05-04T12:12:34","slug":"modify-location-data-before-rendering-map-list-view-eg-customize-marker-icon","status":"publish","type":"ht_kb","link":"https:\/\/www.open-user-map.com\/fr\/knowledge-base\/modify-location-data-before-rendering-map-list-view-eg-customize-marker-icon\/","title":{"rendered":"Modifier les donn\u00e9es de localisation avant le rendu (vue carte et liste, par exemple personnaliser l'ic\u00f4ne du marqueur)"},"content":{"rendered":"<p>Vous pouvez personnaliser les donn\u00e9es de chaque lieu avant qu'elles ne soient affich\u00e9es sur la carte ou dans la liste. Cela peut s'av\u00e9rer utile si vous souhaitez afficher des ic\u00f4nes de rep\u00e9rage sp\u00e9cifiques pour certains lieux.<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#f6f6f4;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\" data-no-translation=\"\" data-no-auto-translation=\"\"><span style=\"display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#333545;color:#ebebe6\">PHP<\/span><pre class=\"shiki dracula-soft\" style=\"background-color: #282A36\" tabindex=\"0\"><code data-no-translation=\"\" data-no-auto-translation=\"\"><span class=\"line\"><span style=\"color: #62E884\">add_filter<\/span><span style=\"color: #F6F6F4\">(<\/span><span style=\"color: #DEE492\">&#39;<\/span><span style=\"color: #E7EE98\">oum_location_data<\/span><span style=\"color: #DEE492\">&#39;<\/span><span style=\"color: #F6F6F4\">,<\/span><span style=\"color: #62E884\"> <\/span><span style=\"color: #F286C4\">function<\/span><span style=\"color: #62E884\"> <\/span><span style=\"color: #F6F6F4\">(<\/span><span style=\"color: #62E884\"> <\/span><span style=\"color: #F6F6F4\">$location_data,<\/span><span style=\"color: #62E884\"> <\/span><span style=\"color: #F6F6F4\">$post_id<\/span><span style=\"color: #62E884\"> <\/span><span style=\"color: #F6F6F4\">)<\/span><span style=\"color: #62E884\"> <\/span><span style=\"color: #F6F6F4\">{<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">  <\/span><span style=\"color: #7B7F8B\">\/\/ Example: Change marker icon based on custom logic<\/span><\/span>\n<span class=\"line\"><span style=\"color: #62E884\">  <\/span><span style=\"color: #F286C4\">if<\/span><span style=\"color: #62E884\"> <\/span><span style=\"color: #F6F6F4\">(<\/span><span style=\"color: #62E884\"> <\/span><span style=\"color: #F6F6F4\">$post_id<\/span><span style=\"color: #62E884\"> <\/span><span style=\"color: #F286C4\">==<\/span><span style=\"color: #62E884\"> <\/span><span style=\"color: #BF9EEE\">123<\/span><span style=\"color: #62E884\"> <\/span><span style=\"color: #F6F6F4\">)<\/span><span style=\"color: #62E884\"> <\/span><span style=\"color: #F6F6F4\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #62E884\">    <\/span><span style=\"color: #F6F6F4\">$location_data&#91;<\/span><span style=\"color: #DEE492\">&#39;<\/span><span style=\"color: #E7EE98\">icon<\/span><span style=\"color: #DEE492\">&#39;<\/span><span style=\"color: #F6F6F4\">&#93;<\/span><span style=\"color: #62E884\"> <\/span><span style=\"color: #F286C4\">=<\/span><span style=\"color: #62E884\"> <\/span><span style=\"color: #DEE492\">&#39;<\/span><span style=\"color: #E7EE98\">https:\/\/example.com\/custom-marker.png<\/span><span style=\"color: #DEE492\">&#39;<\/span><span style=\"color: #F6F6F4\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #62E884\">  <\/span><span style=\"color: #F6F6F4\">}<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">  <\/span><span style=\"color: #7B7F8B\">\/\/ You can modify any property of $location_data:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">  <\/span><span style=\"color: #7B7F8B\">\/\/ - icon: marker icon URL (works for map markers and list view)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">  <\/span><span style=\"color: #7B7F8B\">\/\/ - title, lat, lng, zoom, types, post_id, address, text, image, audio, video, custom_fields, votes, etc.<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">  <\/span><span style=\"color: #7B7F8B\">\/\/ - content: plain text for the map marker search only (not the popup HTML). Full bubble markup is built<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">  <\/span><span style=\"color: #7B7F8B\">\/\/   on the server and can be changed with the oum_location_bubble_content filter (or oum_location_bubble_image).<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #62E884\">  <\/span><span style=\"color: #F286C4\">return<\/span><span style=\"color: #62E884\"> <\/span><span style=\"color: #F6F6F4\">$location_data;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">},<\/span><span style=\"color: #62E884\"> <\/span><span style=\"color: #BF9EEE\">10<\/span><span style=\"color: #F6F6F4\">,<\/span><span style=\"color: #62E884\"> <\/span><span style=\"color: #BF9EEE\">2<\/span><span style=\"color: #F6F6F4\">);<\/span><\/span><\/code><\/pre><\/div>","protected":false},"excerpt":{"rendered":"<p>Vous pouvez personnaliser les donn\u00e9es de chaque lieu avant qu'elles ne soient affich\u00e9es sur la carte ou dans la liste. Cela peut s'av\u00e9rer utile si vous souhaitez afficher des ic\u00f4nes de rep\u00e9rage sp\u00e9cifiques pour certains lieux.<\/p>","protected":false},"author":50,"comment_status":"closed","ping_status":"closed","template":"","format":"standard","meta":{"footnotes":""},"ht-kb-category":[25],"ht-kb-tag":[58,27,59,55],"class_list":["post-6738","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-customization","ht_kb_tag-custom","ht_kb_tag-custom-fields","ht_kb_tag-icon","ht_kb_tag-marker"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Modify location data before rendering (map &amp; list view, eg. customize marker icon) - Open User Map<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.open-user-map.com\/fr\/knowledge-base\/modify-location-data-before-rendering-map-list-view-eg-customize-marker-icon\/\" \/>\n<meta property=\"og:locale\" content=\"fr_FR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Modify location data before rendering (map &amp; list view, eg. customize marker icon) - Open User Map\" \/>\n<meta property=\"og:description\" content=\"You can customize the data for each location before it is getting rendered on the map or in the list. This can be useful if you want to display specific marker icons for certain locations.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.open-user-map.com\/fr\/knowledge-base\/modify-location-data-before-rendering-map-list-view-eg-customize-marker-icon\/\" \/>\n<meta property=\"og:site_name\" content=\"Open User Map\" \/>\n<meta property=\"article:modified_time\" content=\"2026-05-04T12:12:34+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Dur\u00e9e de lecture estim\u00e9e\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"TechArticle\",\"@id\":\"https:\/\/www.open-user-map.com\/knowledge-base\/modify-location-data-before-rendering-map-list-view-eg-customize-marker-icon\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.open-user-map.com\/knowledge-base\/modify-location-data-before-rendering-map-list-view-eg-customize-marker-icon\/\"},\"author\":{\"name\":\"Daniel Sch\u00f6nherr\",\"@id\":\"https:\/\/www.open-user-map.com\/#\/schema\/person\/d9c8cbe470ae2702b6de61e0f73a7402\"},\"headline\":\"Modify location data before rendering (map &amp; list view, eg. customize marker icon)\",\"datePublished\":\"2026-05-04T12:12:33+00:00\",\"dateModified\":\"2026-05-04T12:12:34+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.open-user-map.com\/knowledge-base\/modify-location-data-before-rendering-map-list-view-eg-customize-marker-icon\/\"},\"wordCount\":49,\"publisher\":{\"@id\":\"https:\/\/www.open-user-map.com\/#organization\"},\"inLanguage\":\"fr-FR\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.open-user-map.com\/knowledge-base\/modify-location-data-before-rendering-map-list-view-eg-customize-marker-icon\/\",\"url\":\"https:\/\/www.open-user-map.com\/knowledge-base\/modify-location-data-before-rendering-map-list-view-eg-customize-marker-icon\/\",\"name\":\"Modify location data before rendering (map &amp; list view, eg. customize marker icon) - Open User Map\",\"isPartOf\":{\"@id\":\"https:\/\/www.open-user-map.com\/#website\"},\"datePublished\":\"2026-05-04T12:12:33+00:00\",\"dateModified\":\"2026-05-04T12:12:34+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.open-user-map.com\/knowledge-base\/modify-location-data-before-rendering-map-list-view-eg-customize-marker-icon\/#breadcrumb\"},\"inLanguage\":\"fr-FR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.open-user-map.com\/knowledge-base\/modify-location-data-before-rendering-map-list-view-eg-customize-marker-icon\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.open-user-map.com\/knowledge-base\/modify-location-data-before-rendering-map-list-view-eg-customize-marker-icon\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.open-user-map.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Modify location data before rendering (map &amp; list view, eg. customize marker icon)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.open-user-map.com\/#website\",\"url\":\"https:\/\/www.open-user-map.com\/\",\"name\":\"Open User Map\",\"description\":\"WordPress Map Plugin\",\"publisher\":{\"@id\":\"https:\/\/www.open-user-map.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.open-user-map.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"fr-FR\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.open-user-map.com\/#organization\",\"name\":\"Open User Map\",\"url\":\"https:\/\/www.open-user-map.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"fr-FR\",\"@id\":\"https:\/\/www.open-user-map.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.open-user-map.com\/wp-content\/uploads\/2023\/09\/icon-256x256-1.png\",\"contentUrl\":\"https:\/\/www.open-user-map.com\/wp-content\/uploads\/2023\/09\/icon-256x256-1.png\",\"width\":256,\"height\":256,\"caption\":\"Open User Map\"},\"image\":{\"@id\":\"https:\/\/www.open-user-map.com\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.open-user-map.com\/#\/schema\/person\/d9c8cbe470ae2702b6de61e0f73a7402\",\"name\":\"Daniel Sch\u00f6nherr\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Modifier les donn\u00e9es de localisation avant l'affichage (carte et liste, par exemple personnaliser l'ic\u00f4ne d'un rep\u00e8re) - Open User Map","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.open-user-map.com\/fr\/knowledge-base\/modify-location-data-before-rendering-map-list-view-eg-customize-marker-icon\/","og_locale":"fr_FR","og_type":"article","og_title":"Modify location data before rendering (map &amp; list view, eg. customize marker icon) - Open User Map","og_description":"You can customize the data for each location before it is getting rendered on the map or in the list. This can be useful if you want to display specific marker icons for certain locations.","og_url":"https:\/\/www.open-user-map.com\/fr\/knowledge-base\/modify-location-data-before-rendering-map-list-view-eg-customize-marker-icon\/","og_site_name":"Open User Map","article_modified_time":"2026-05-04T12:12:34+00:00","twitter_card":"summary_large_image","twitter_misc":{"Dur\u00e9e de lecture estim\u00e9e":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"TechArticle","@id":"https:\/\/www.open-user-map.com\/knowledge-base\/modify-location-data-before-rendering-map-list-view-eg-customize-marker-icon\/#article","isPartOf":{"@id":"https:\/\/www.open-user-map.com\/knowledge-base\/modify-location-data-before-rendering-map-list-view-eg-customize-marker-icon\/"},"author":{"name":"Daniel Sch\u00f6nherr","@id":"https:\/\/www.open-user-map.com\/#\/schema\/person\/d9c8cbe470ae2702b6de61e0f73a7402"},"headline":"Modify location data before rendering (map &amp; list view, eg. customize marker icon)","datePublished":"2026-05-04T12:12:33+00:00","dateModified":"2026-05-04T12:12:34+00:00","mainEntityOfPage":{"@id":"https:\/\/www.open-user-map.com\/knowledge-base\/modify-location-data-before-rendering-map-list-view-eg-customize-marker-icon\/"},"wordCount":49,"publisher":{"@id":"https:\/\/www.open-user-map.com\/#organization"},"inLanguage":"fr-FR"},{"@type":"WebPage","@id":"https:\/\/www.open-user-map.com\/knowledge-base\/modify-location-data-before-rendering-map-list-view-eg-customize-marker-icon\/","url":"https:\/\/www.open-user-map.com\/knowledge-base\/modify-location-data-before-rendering-map-list-view-eg-customize-marker-icon\/","name":"Modifier les donn\u00e9es de localisation avant l'affichage (carte et liste, par exemple personnaliser l'ic\u00f4ne d'un rep\u00e8re) - Open User Map","isPartOf":{"@id":"https:\/\/www.open-user-map.com\/#website"},"datePublished":"2026-05-04T12:12:33+00:00","dateModified":"2026-05-04T12:12:34+00:00","breadcrumb":{"@id":"https:\/\/www.open-user-map.com\/knowledge-base\/modify-location-data-before-rendering-map-list-view-eg-customize-marker-icon\/#breadcrumb"},"inLanguage":"fr-FR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.open-user-map.com\/knowledge-base\/modify-location-data-before-rendering-map-list-view-eg-customize-marker-icon\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.open-user-map.com\/knowledge-base\/modify-location-data-before-rendering-map-list-view-eg-customize-marker-icon\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.open-user-map.com\/"},{"@type":"ListItem","position":2,"name":"Modify location data before rendering (map &amp; list view, eg. customize marker icon)"}]},{"@type":"WebSite","@id":"https:\/\/www.open-user-map.com\/#website","url":"https:\/\/www.open-user-map.com\/","name":"Open User Map","description":"Plugin WordPress Map","publisher":{"@id":"https:\/\/www.open-user-map.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.open-user-map.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"fr-FR"},{"@type":"Organization","@id":"https:\/\/www.open-user-map.com\/#organization","name":"Open User Map","url":"https:\/\/www.open-user-map.com\/","logo":{"@type":"ImageObject","inLanguage":"fr-FR","@id":"https:\/\/www.open-user-map.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.open-user-map.com\/wp-content\/uploads\/2023\/09\/icon-256x256-1.png","contentUrl":"https:\/\/www.open-user-map.com\/wp-content\/uploads\/2023\/09\/icon-256x256-1.png","width":256,"height":256,"caption":"Open User Map"},"image":{"@id":"https:\/\/www.open-user-map.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.open-user-map.com\/#\/schema\/person\/d9c8cbe470ae2702b6de61e0f73a7402","name":"Daniel Sch\u00f6nherr"}]}},"_links":{"self":[{"href":"https:\/\/www.open-user-map.com\/fr\/wp-json\/wp\/v2\/ht-kb\/6738","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.open-user-map.com\/fr\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/www.open-user-map.com\/fr\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.open-user-map.com\/fr\/wp-json\/wp\/v2\/users\/50"}],"replies":[{"embeddable":true,"href":"https:\/\/www.open-user-map.com\/fr\/wp-json\/wp\/v2\/comments?post=6738"}],"version-history":[{"count":1,"href":"https:\/\/www.open-user-map.com\/fr\/wp-json\/wp\/v2\/ht-kb\/6738\/revisions"}],"predecessor-version":[{"id":6739,"href":"https:\/\/www.open-user-map.com\/fr\/wp-json\/wp\/v2\/ht-kb\/6738\/revisions\/6739"}],"wp:attachment":[{"href":"https:\/\/www.open-user-map.com\/fr\/wp-json\/wp\/v2\/media?parent=6738"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/www.open-user-map.com\/fr\/wp-json\/wp\/v2\/ht-kb-category?post=6738"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/www.open-user-map.com\/fr\/wp-json\/wp\/v2\/ht-kb-tag?post=6738"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}