Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address not saved on post saving #36

Open
widoz opened this issue Feb 22, 2016 · 3 comments
Open

Address not saved on post saving #36

widoz opened this issue Feb 22, 2016 · 3 comments

Comments

@widoz
Copy link

widoz commented Feb 22, 2016

As per title, the address map is not saved, only latitude and longitude

@mustardBees
Copy link
Owner

Hi @widoz. This has been suggested a few times, it's possible to tweak the field to also save the search field.

For me, this goes beyond the initial scope of the field, it was intended to simply save lat/long. The field can be used alongside additional fields to save address information in any format required.

It's knowing at what point to stop. The next feature request will be to save each address component separately. These are all great features but move the field away from being a lightweight, simple map field implementation.

I think saving the address in the search field is worthwhile. I'm undecided whether this should be an additional option or on by default?

@widoz
Copy link
Author

widoz commented Feb 25, 2016

Hi @mustardBees

Thank you for your response. Right now I changed the field input by adding the input search as cmb2 field in this way:

echo $field_type_object->input( array(
    'type'  => 'text',
    'name'  => $field->args( '_name' ) . '[address]',
    'value' => isset( $field_escaped_value['address'] ) ? $field_escaped_value['address'] : '',
    'class' => 'large-text pw-map-search',
    'desc'  => '',
) );

And works well. At least you can ignore the array item.

@yeahsmaggy
Copy link

I used your code and I think this is useful functionality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants