Keep text address in address cf

This topic contains 3 reply and 2 voices, and was last updated by jman057 10 years, 7 months ago
Viewing 3 Posts - 1 through 3 (of 3 total)
Author Posts
September 10, 2013 at 2:15 pm 7983
jman057 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
September 22, 2013 at 3:41 pm 8423
jman057 jman057

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

September 22, 2013 at 5:22 pm 8436
Tareq Hasan Tareq Hasan

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

September 23, 2013 at 2:50 pm 8463
jman057 jman057

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 3 Posts - 1 through 3 (of 3 total)