• Resolved Reppiks

    (@reppiks)


    Greetings Shanebp and others,

    Love the plug-in. I was wondering is there a way to not allow users to add a location that doesn’t exist? For example, I live in Memphis, TN and it is often referred to as M-Town. If I type that in Memphis comes up but if I don’t choose the auto-completed suggestion MTown will still be set as the location.
    This may be beyond the scope of this plug-in and more on Google’s APIs but wanted to know if anybody had any insight on the matter.

    Cheers!

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

    (@shanebp)

    Currently, this plugin relies on selecting a Google suggestion.

    We aren’t sure how to ‘disallow’ not selecting a suggestion.
    But it’s a good idea and we will put it on the to-do list.
    Although, it would have to be an option.

    Plugin Author shanebp

    (@shanebp)

    We can :

    • add an option on field creation re forcing the user to make a selection from google addresses
    • prevent saving if a google address has not been selected on the INITAL edit of a location field
    • but there is no way to prevent the user from subsequently typing an address in the field and saving it

    So all we can suggest is that you ask the user to make a selection.

    You can add a message by opening this file:
    bp-xprofile-location\inc\class-pp-field-type-location.php

    Finding this line:
    $label_name = substr_replace($label_name, '​', 1, 0);

    And changing it to this:

    $label_name = substr_replace($label_name, '​', 1, 0);
    $label_name .= " <em>(please select from the auto-complete suggestions below.)</em>";
    Thread Starter Reppiks

    (@reppiks)

    Thanks for the awesome feedback. That would be a neat feature if you guys get a chance to figure it out. Wish you the best of luck in that endeavor. I figured it was a stretch for it to be a simple solution. You went above and beyond with the tip for adding the message. Will try it out once I get a bit of sleep.

    Thanks again for your help,
    Cheers!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Is there a way to not allow lacations that don’t exist in google autocomplete’ is closed to new replies.