lriaudel / cpt-to-map-store

An another Store Locator but with Open Street Map & Leaflet available on wp.org : https://wordpress.org/plugins/cpt-to-map-store/
GNU General Public License v3.0
3 stars 1 forks source link

The photos does not appear in the pin popup #2

Closed assoscoupa closed 4 years ago

assoscoupa commented 4 years ago

I have a custom field for photography in my installation which I call "photo".

When I enter the {photo} in the Template popup, then the only thing that returns is the id attachment.

The Template popup does not accept php code to write dynamically.

What is the solution?

Thanks!

lriaudel commented 4 years ago

Hi,

Do you want a filter to customize the marker ?

image

lriaudel commented 4 years ago

Here the code to hook in 1.0.3 version:

function bindPopup_content_filter( $bindPopup_content, $post_id ) {
    return "Yeahhhhh";
}
add_filter( 'cpt_to_map_store_bindPopup_content', 'bindPopup_content_filter', 10, 2 );
lriaudel commented 4 years ago

@assoscoupa It is ok for you ?

assoscoupa commented 4 years ago

I put your code to the test and it worked fine.

But I didn't manage to show my own field.

Could you give me a code example of how I should write it so that I can display, for example, my own field called "property_status" ?

assoscoupa commented 4 years ago

It is also possible to disable the rolling wheel zoom on the map?

lriaudel commented 4 years ago

In this filter, you can put your code to get the different fields : ACF : https://www.advancedcustomfields.com/resources/get_field/ WP : https://developer.wordpress.org/reference/functions/get_post_meta/ And generate your own template

lriaudel commented 4 years ago

For the wheel, can you open a other issue ? Have you an example ?