an
groups-icon

Geomywp integration

Wait a minute... This content is very very old. We no longer sell or support this theme version. New Topics
  • Version 9
    Walter Vidotto
    0 points
    Beginner

    I want passed the geolocation info (from tab profile location of listing) at geomywp plugins
    how i can this, any want help ?

    found a couple of code integration for formidablepro :

    [code title=””]function gmw_save_frm_post_data( $entry_id, $form_id ) {
    //change the value 3 to the form ID that you want to use.
    //this will make sure that the script runs only in the needed form
    if ( $form_id != 3 )
    return;
    global $frmdb;
    //get the ID of the new post created
    $post_id = $frmdb->get_var( $frmdb->entries, array(‘id’ => $entry_id), ‘post_id’ );
    //setup arguments for GEO my WP geocoder function
    $args = array(
    ‘post_id’ => $post_id, //post ID
    ‘post_type’ => get_post_type( $post_id ), //post Type
    ‘post_title’ => get_the_title( $post_id ), //Post title
    ‘address’ => $_POST[‘item_meta’][8], //address – change the value 8 to the address field ID of your form
    ‘additional_info’ => array( ‘phone’ => false, ‘fax’ => false, ’email’ => false, ‘website’ => false ),
    ‘map_icon’ => ‘_default.png’,
    );
    //include the file with the geocode function
    include_once( GMW_PT_PATH .’includes/gmw-pt-update-location.php’ );
    //the function
    gmw_pt_update_location( $args );

    }
    //hook for new post created
    add_action( ‘frm_after_create_entry’, ‘gmw_save_frm_post_data’, 50, 2 );
    //hook when post updated
    add_action( ‘frm_after_update_entry’, ‘gmw_save_frm_post_data’, 10, 2 );[/code]

    also integration forwp user frontend :

    [code title=””]function gmw_update_location_via_wpuf( $post_id ) {
    //make sure we have post ID
    if ( !$post_id )
    return;
    //change meta_field_name to the custom field of the address field
    $address = get_post_meta( $post_id, ‘cf_address’, true );
    //include geocoder file
    include_once( GMW_PT_PATH .’/includes/gmw-pt-update-location.php’ );
    if ( function_exists( ‘gmw_pt_update_location’ ) ) {
    //setup geocoder args
    $args = array(
    ‘post_id’ => $post_id,
    ‘post_type’ => get_post_type( $post_id ), // change post_type to your own
    ‘post_title’ => get_the_title( $post_id ),
    ‘address’ => $address
    );
    //run geocoder function
    gmw_pt_update_location( $args );
    }
    }
    //update data of new post
    add_action(‘wpuf_add_post_after_insert’, ‘gmw_update_location_via_wpuf’, 10, 1 );
    //update data when post updated
    add_action(‘wpuf_add_post_after_updated’, ‘gmw_update_location_via_wpuf’, 10, 1 );
    [/code]

    August 27, 2014 at 9:01 am
  • Mark Fail
    11,845 points
    Platinum User
    Bronze User Silver User Gold User Platinum User Helpful Award Fast Responder Thank You Coffee Villian Award Video Testimonial
    Members Only Content

    This reply is for PremiumPress customers only.

    Login Now
    August 27, 2014 at 9:03 am
  • Walter Vidotto
    0 points
    Beginner
    Members Only Content

    This reply is for PremiumPress customers only.

    Login Now
    August 27, 2014 at 9:11 am

566

Views

2

Replies