WordPress.org

Ready to get started?Download WordPress

Forums

Simple Real Estate Pack
[resolved] Limiting Google Maps to display Restaurants and Grocery alone (10 posts)

  1. t.rex888
    Member
    Posted 1 year ago #

    Wondering if it's possible to display the Google Map with only Restaurants and Grocery Stores, removing Schools, Banks, etc.? If so, how would I do so?

    http://wordpress.org/extend/plugins/simple-real-estate-pack-4/

  2. Max Chirkov
    Member
    Plugin Author

    Posted 1 year ago #

    Well, you can hack the plugin - edit this file includes/srp-yelp.php - scroll down until you see an array of Yelp categories, comment out the categories that you don't need. That should do the trick.

  3. t.rex888
    Member
    Posted 1 year ago #

    That was easy, thanks. One small issue remains though. I do not see an option to comment out the School category. Where is this done exactly?

  4. Max Chirkov
    Member
    Plugin Author

    Posted 1 year ago #

    Yes, I forgot about the schools... schools are implemented separately, unfortunately I can't find where exactly they are being added at this moment. This plugin is a mess, I'm working on rebuilding it.

  5. t.rex888
    Member
    Posted 1 year ago #

    Ok. If you are able to locate it please do keep me posted. I can't use the Plug-in with schools as a category I'm afraid.

  6. Max Chirkov
    Member
    Plugin Author

    Posted 1 year ago #

    I think I found it - it's in the /includes/srp-education.php - scroll to the very bottom of the file and comment out this line:

    add_filter('_add_to_yelpselect', '_schools_checkbox');

    This should remove the schools checkbox from the Map.

  7. t.rex888
    Member
    Posted 1 year ago #

    I thought you had it but it's not quite right. Commenting out that line turns my webpage background blue and creates a funny rectangular shape underneath the Categories that I currently have in place, Grocery Stores and Restaurants. I've tried commenting out various other lines, both including and not including the line you suggested but no luck so far. Any other ideas?

  8. Max Chirkov
    Member
    Plugin Author

    Posted 1 year ago #

    I just checked and you're right, it doesn't exactly work as I expected... which is pretty weird. right before that line, there is _schools_checkbox() function - that's the function that returns the checkbox field within the filter. I simply added return; right before the original return and it worked. Here is my example:

    function _schools_checkbox(){
        return;
        return '<input id="schools_cat_schools" type="checkbox"><label for="schools_cat_schools">Schools</label><br />' . "\n";
    }

    You can completely remove the second return if your want. I just did that for testing.

  9. t.rex888
    Member
    Posted 1 year ago #

    In a million years I would not have thought to do that. Works perfectly, thank you very much! Really appreciate it.

  10. Max Chirkov
    Member
    Plugin Author

    Posted 1 year ago #

    Yea, I still don't understand why the first solution didn't work - I'd expect it to have the same effect as the last one. In any case - you're welcome!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.