Support » Plugin: Leaflet Map » Using php variable in shortcode

  • Messaone

    (@messaone)


    I try to use your shortcode in a loop.

    $address = $module->render_post_address( $post_id );;
    echo do_shortcode( sprintf( '[leaflet-marker address="%s"]', $address ) );

    It only adds the adress under the map.
    Maybe you have an idea how i can use it like that.

    • This topic was modified 9 months ago by  Messaone.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author bozdoz

    (@bozdoz)

    I’m surprised it didn’t work! I’ll have to try this myself and get back to you. Thanks for the interesting use case!

    Messaone

    (@messaone)

    Oky now it works after reset the plugin.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Using php variable in shortcode’ is closed to new replies.