makeitworkpress / wp-custom-fields

WP Custom Fields is an options, metabox and customizer framework for WordPress aimed at speeding-up plug-in and theme development.
https://makeitwork.press/scripts/wp-custom-fields/
GNU General Public License v3.0
70 stars 15 forks source link

'Location' field saves lat + long but not the rest of the address pieces #5

Closed netsparkle closed 2 years ago

netsparkle commented 3 years ago

It seems like only lat + long get sent to $_POST, I am working on how to solve this but wonder if you have any ideas?

leichim commented 3 years ago

Thanks for letting me know! In what context (meta or options page)?

I pushed another update yesterday, can you check it again? The other fields should also be saved and they actually do here in my dev environment. If you do a var dump for the $_POST, you should have something like this in your $_POST for the location field: array (size=7) 'lat' => string '51.939978' (length=9) 'lng' => string '4.4795829' (length=9) 'street' => string 'Bergweg' (length=7) 'number' => string '' (length=0) 'postal_code' => string '' (length=0) 'city' => string 'Rotterdam' (length=9) 'country' => string 'Netherlands' (length=11)

netsparkle commented 3 years ago

on the meta page, thanks! I will see if the update works for me

netsparkle commented 3 years ago

I updated it and got it to work, but it doesn't pull 'State'

netsparkle commented 3 years ago

Thanks for letting me know! In what context (meta or options page)?

I pushed another update yesterday, can you check it again? The other fields should also be saved and they actually do here in my dev environment. If you do a var dump for the $_POST, you should have something like this in your $_POST for the location field: array (size=7) 'lat' => string '51.939978' (length=9) 'lng' => string '4.4795829' (length=9) 'street' => string 'Bergweg' (length=7) 'number' => string '' (length=0) 'postal_code' => string '' (length=0) 'city' => string 'Rotterdam' (length=9) 'country' => string 'Netherlands' (length=11)

Is there a way to get 'state'?

leichim commented 3 years ago

I see, I need to update the code as state is not outputted here. I'll push an update.

leichim commented 3 years ago

Update is pushed for supporting state. Could you check it?

netsparkle commented 3 years ago

it works, should use component.short_name for state i think so you get the abbreviation instead of the whole name