WordPress.org

Forums

Basic Google Maps Placemarks
Small addition: insert many placemarks in the map using their IDs (4 posts)

  1. leoloso
    Member
    Posted 2 years ago #

    Hi there, thanks for the great plugin! I have a small suggestion:

    In public function getMapPlacemarks( $attributes ), the following line:

    $query[ 'p' ] = $attributes[ 'placemark' ];

    can be replaced with:

    $query[ 'post__in' ] = explode(",",$attributes[ 'placemark' ]);

    This allows to add more than 1 placemark in the map specifying the IDs (eg: placemark="154, 467, 334"), so no need to have all these placemarks under one common category anymore.

    Cheers,
    Leo

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

  2. Ian Dunn
    Member
    Plugin Author

    Posted 2 years ago #

    That's a good idea, thanks. I'll look at doing that for the next release.

    It may affect backwards-compatability, though. If I'm not able to do it, you should be able to use one of the filters to remove the p item and add the post__in item.

  3. leoloso
    Member
    Posted 2 years ago #

    Hi Ian, I don't think it will affect backwards compatibility: if only 1 ID is specified (without a comma) it still works, I've tested it

    (or you could also add another param, placemarks, as to be sure)

    Cool you like it! Cheers,
    Leo

  4. Ian Dunn
    Member
    Plugin Author

    Posted 2 years ago #

    I'm mainly worried about other people's customizations, e.g., if they're using a filter to change the value of p, and assuming that post__in doesn't exist. In that case, both p and post__in would exist when the query runs, and I'm not sure how that would affect it.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.