Home Forums Plugin Support WP User Frontend (Free Version) Keep text address in address cf

This topic is: resolved

Tagged: , ,

This topic contains 3 replies, has 2 voices, and was last updated by  jman057 5 years, 9 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #7983

    jman057
    Participant
    Post count: 16

    Hi Tareq,

    trying to keep the text version of the address so that it can be posted alongside the pronamic map, but having trouble with this. I've tried the function you provided to another user:

    function wpufe_inesrt_address( $post_id ) {
    if ( isset( $_POST['find-address'] ) ) {
    update_post_meta( $post_id, ‘cf_address’, $_POST['find-address'] );
    }
    }
    add_action( ‘wpuf_add_post_after_insert’, ‘wpufe_inesrt_address’ );
    add_action( ‘wpuf_edit_post_after_update’, ‘wpufe_inesrt_address’ );

    But that didn't seem to work. I replaced ‘cf_address' with ‘address' which is the name of the cf.

    I've tried removing the conditional ‘if', and tried embedding in another function you provided that uses the same action hook that works, but it doesnt seem to work. I've tried to update_post_meta to another cf, and that hasn't worked.

    Any suggestions or things I should try or ways to figure out how it's not working?

    Cheers,

    Jamie

    #8423

    jman057
    Participant
    Post count: 16

    Any suggestions on the previous?

    I've also tried setting the priority to “1” with:

    add_action( ‘wpuf_add_post_after_insert’, ‘wpufe_inesrt_address’, 1 );
    add_action( ‘wpuf_edit_post_after_update’, ‘wpufe_inesrt_address’, 1 );

    I've deactivated all other functions that I've added that use these action hooks

    Would be great if I could echo the address without having to ask the user to enter it twice. I'm open to other ideas (is there a way to convert the coordinates to text address?)

    Many thanks in advance!

    Jamie

    #8436

    Tareq Hasan
    Keymaster
    Post count: 2831

    The code works for me, tested it again just now!

    #8463

    jman057
    Participant
    Post count: 16

    okay found where it went wrong, the single quotations weren't the right kind of single quotations so it wasn't reading it as a string (if you look closely you can see they are different), so I went over those and solved it 🙂

    Cheers,

    Jamie

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Keep text address in address cf’ is closed to new replies.