WordPress.org

Support

Support » Plugins and Hacks » Small addition: insert many placemarks in the map using their IDs

Small addition: insert many placemarks in the map using their IDs

  • 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/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Ian Dunn

    @iandunn

    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.

    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

    Plugin Author Ian Dunn

    @iandunn

    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.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Small addition: insert many placemarks in the map using their IDs’ is closed to new replies.