- This topic has 4 replies, 2 voices, and was last updated 2 years, 2 months ago by .
-
Topic
-
I have a field for the neighborhood. Sometimes google will return a neighborhood value for an address and this will autopopulate because the field ID auto binds:
array( 'type' => 'text', 'name' => __('Neighborhood', 'psych-info'), 'id' => 'neighborhood', ),
The issue is when google does not return a neighborhood value, then this field is cleared of any existing value. I know I can change the ID to prevent the auto-binding, but maybe this could be improved?
I can think of a couple of workarounds:
- add a fill bind_if_empty flag in the plugin:
array( 'type' => 'text', 'name' => __('Neighborhood', 'psych-info'), 'id' => 'neighborhood', 'binding' => 'neighborhood', 'bind_if_empty' => false, //default true ),
bind_if_empty might also accept a secondary field to bind if the first field is empty:
'binding' => 'neighborhood', 'bind_if_empty' => 'sublocality'
- Allow the binding to be filtered by a function
I am happy to extend the plugin. If so, is there a private repo I can submit a pull request to?
P.S. There is a typo in the Features section on the extension's page:
Auto popular all location fields when user enter an address
should read:
Auto populate all location fields... - add a fill bind_if_empty flag in the plugin:
- You must be logged in to reply to this topic.