• I would like to save/record the submitted/searched for addresses from the users as it is valuable data for our client. Do you know how I can add that functionality in?

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter tatummatlock

    (@tatummatlock)

    Hello, still looking for an answer on this.. Thanks!

    Plugin Author Eyal Fitoussi

    (@ninjew)

    Hello @tatummatlock,

    There are some hooks that execute when GEO my WP’s search form is submitted. You could use one of those hooks to write a custom function that will grab the address that was submitted and save it in some place of your choice in the database. This could be a custom field or in a custom database table that you could create.

    One filter you could use is

    
    apply_filters( 'gmw_default_form_values', $this->form, $this );
    

    The first argument is GEO my WP’s form object ( which is actually an array ). And you could retrieve the submitted values in your custom function using $form[‘form_values’]. The address would be in $form[‘form_values’][‘address’].

    I hope this helps.

    • This reply was modified 3 years, 9 months ago by Eyal Fitoussi.
    Thread Starter tatummatlock

    (@tatummatlock)

    Hi @ninjew I’m struggling with this. I have limited knowledge of php. What is the variable I am trying to get from the form and record? $gmw_default_form_values? I don’t understand what a hook is. I had assumed I just needed to capture a variable after the form was submitted. Any additional information you can provide would be very helpful.

    I’ve read tutorials on how to take submitted data from a form and post it as a custom post type.. then we could easily see everything on the back end. I’d just need to record the date as the title and then that variable as the post content: https://wordpress.stackexchange.com/questions/11288/form-to-add-posts-to-custom-post-type

    However, I’m not sure where I would put this code once I’ve finished it.. would I place it here? geo-my-wp/plugins/posts-locator/includes/class-gmw-post-location-form.php

    Thank you for your help!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Record Submitted Addresses’ is closed to new replies.