WordPress.org

Ready to get started?Download WordPress

Forums

Basic Google Maps Placemarks
[resolved] Line breaks added to description popup (5 posts)

  1. chodorowicz
    Member
    Posted 2 years ago #

    I have strange problem - I've added list items to my description popup. The problem is that they are outputted with <br> tags between <li>. When I enter the HTML edit mode and put everyting in one line of code like <ul><li>text... then the output is OK.

    Do you have any idea what might be the problem?

    Btw. I'm blown away by this plugin - the best Google Maps integration plugin out there!

    http://wordpress.org/extend/plugins/basic-google-maps-placemarks/

  2. Ian Dunn
    Member
    Plugin Author

    Posted 2 years ago #

    The plugin passes the description through PHP's nl2br() function, which is probably what's causing that. I don't remember exactly why I put that in there, but I think it was because paragraph breaks were stripped without it. There's probably a better way to do it, though, so I'll look into fixing it in a future release.

    In the mean time, you can make a simple change to the code to fix it:

    For the [bgmp-map] shortcode, edit the getPlacemarks() method. In version 1.5.1, change line 629 from

    'details' => nl2br( $pp->post_content ),
    to
    'details' => $pp->post_content,

    For the [bgmp-list] shortcode, edit the listShortcode() method. In version 1.5.1, change line 555 from

    nl2br( $p->post_content ),
    to
    $p->post_content,

  3. chodorowicz
    Member
    Posted 2 years ago #

    Thanks a lot Ian for help. I'll be also checking out your blog, looks interesting! Greets

  4. Ian Dunn
    Member
    Plugin Author

    Posted 2 years ago #

    Version 1.6 uses wpautop() instead of nl2br(), which fixes this.

  5. chodorowicz
    Member
    Posted 2 years ago #

    Great, thanks!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic