Forum Replies Created

Viewing 9 Topics - 1 through 9 (of 9 total)
Author Posts
September 9, 2013 at 12:42 pm in reply to: custom field (image) not saved 7945
lwrkrol lwrkrol

Weel it works when there is only 1 statement that does this. I wanted to add some more but then it’s not working anymore:
‘specialImage’ => isset( $_POST[‘wpuf_files’][‘specialImage’] ) ? wp_get_attachment_url( $_POST[‘wpuf_files’][‘specialImage’][0] ) : ”,
‘gallery1’ => isset( $_POST[‘wpuf_files’][‘gallery1’] ) ? wp_get_attachment_url( $_POST[‘wpuf_files’][‘gallery1’][0] ) : ”,
‘gallery2’ => isset( $_POST[‘wpuf_files’][‘gallery2’] ) ? wp_get_attachment_url( $_POST[‘wpuf_files’][‘gallery2’][0] ) : ”,

What am I doing wrong here ? The fields gallery1 and gallery2 stay empty

September 8, 2013 at 3:29 pm in reply to: custom field (image) not saved 7928
lwrkrol lwrkrol

That worked, thank you very much Tareq!

September 8, 2013 at 2:18 pm in reply to: custom field (image) not saved 7922
lwrkrol lwrkrol

I’m not sure how to use that, when I change
‘specialImage’ => isset( $_POST[‘specialImage’] ) ? $_POST[‘specialImage’] : ”,

to

‘specialImage’ => isset( $_POST[‘wpuf_files’][‘specialImage’] ) ? $_POST[‘wpuf_files’][‘specialImage’] : ”,

I get the word: Array in that field.

September 8, 2013 at 1:14 pm in reply to: custom field (image) not saved 7918
lwrkrol lwrkrol

Hi, I think I can get that working but the thing is that the other fields are stored using an array. I thought I could solve it like this, but it creates another metafield instead of adding it to the array.

$ait_dir_item = array (
‘address’ => isset( $_POST[‘address’] ) ? $_POST[‘address’] : ”,
‘zipcode’ => isset( $_POST[‘zipcode’] ) ? $_POST[‘zipcode’] : ”,
‘city’ => isset( $_POST[‘city’] ) ? $_POST[‘city’] : ”,
‘gpsLatitude’ => $def_lat,
‘gpsLongitude’ => $def_long,
‘streetViewLatitude’ => ”,
‘streetViewLongitude’ => ”,
‘streetViewHeading’ => ‘0’,
‘streetViewPitch’ => ‘0’,
‘streetViewZoom’ => ‘0’,
‘telephone’ => isset( $_POST[‘telephone’] ) ? $_POST[‘telephone’] : ”,
’email’ => isset( $_POST[’email’] ) ? $_POST[’email’] : ”,
‘web’ => isset( $_POST[‘web’] ) ? $_POST[‘web’] : ”,
‘facebooklink’ => isset( $_POST[‘facebooklink’] ) ? $_POST[‘facebooklink’] : ”,
‘twitterlink’ => isset( $_POST[‘twitterlink’] ) ? $_POST[‘twitterlink’] : ”,
‘hyveslink’ => isset( $_POST[‘hyveslink’] ) ? $_POST[‘hyveslink’] : ”,
‘youtubelink’ => isset( $_POST[‘youtubelink’] ) ? $_POST[‘youtubelink’] : ”,
‘pinterestlink’ => isset( $_POST[‘pinterestlink’] ) ? $_POST[‘pinterestlink’] : ”,
‘PayiDeal’ => isset( $_POST[‘PayiDeal’] ) ? $_POST[‘PayiDeal’] : ”,
‘PayPayPal’ => isset( $_POST[‘PayPayPal’] ) ? $_POST[‘PayPayPal’] : ”,
‘PayCreditCard’ => isset( $_POST[‘PayCreditCard’] ) ? $_POST[‘PayCreditCard’] : ”,
‘PayOverBoeking’ => isset( $_POST[‘PayOverBoeking’] ) ? $_POST[‘PayOverBoeking’] : ”,
‘thuiswinkel’ => isset( $_POST[‘thuiswinkel’] ) ? $_POST[‘thuiswinkel’] : ”,
‘mkbok’ => isset( $_POST[‘mkbok’] ) ? $_POST[‘mkbok’] : ”,
‘webshopkeurmerk’ => isset( $_POST[‘webshopkeurmerk’] ) ? $_POST[‘webshopkeurmerk’] : ”,
‘qshops’ => isset( $_POST[‘qshops’] ) ? $_POST[‘qshops’] : ”,
‘hoursMonday’ => isset( $_POST[‘hoursMonday’] ) ? $_POST[‘hoursMonday’] : ”,
‘hoursTuesday’ => isset( $_POST[‘hoursTuesday’] ) ? $_POST[‘hoursTuesday’] : ”,
‘hoursWednesday’ => isset( $_POST[‘hoursWednesday’] ) ? $_POST[‘hoursWednesday’] : ”,
‘hoursThursday’ => isset( $_POST[‘hoursThursday’] ) ? $_POST[‘hoursThursday’] : ”,
‘hoursFriday’ => isset( $_POST[‘hoursFriday’] ) ? $_POST[‘hoursFriday’] : ”,
‘hoursSaturday’ => isset( $_POST[‘hoursSaturday’] ) ? $_POST[‘hoursSaturday’] : ”,
‘hoursSunday’ => isset( $_POST[‘hoursSunday’] ) ? $_POST[‘hoursSunday’] : ”,
‘alternativeContent’ => isset( $_POST[‘alternativeContent’] ) ? $_POST[‘alternativeContent’] : ”,
‘specialTitle’ => isset( $_POST[‘specialTitle’] ) ? $_POST[‘specialTitle’] : ”,
‘specialContent’ => isset( $_POST[‘specialContent’] ) ? $_POST[‘specialContent’] : ”,
‘specialPrice’ => isset( $_POST[‘specialPrice’] ) ? $_POST[‘specialPrice’] : ”,
‘specialImage’ => isset( $_POST[‘specialImage’] ) ? $_POST[‘specialImage’] : ”,
);
update_post_meta( $post_id, ‘_ait-dir-item’, $ait_dir_item );
}

add_action( ‘wpuf_add_post_after_insert’, ‘wpufe_ait_integration’ );
add_action( ‘wpuf_edit_post_after_update’, ‘wpufe_ait_integration’ );

// save specialImage
function wpufe_copy_att_url( $post_id ) {
$field_name = ‘specialImageTmp’;
$attach_id = get_post_meta( $post_id, $field_name, true );

if ( $attach_id ) {
$meta_value = wp_get_attachment_url( $attach_id );
update_post_meta( $post_id, ‘specialImage’, $meta_value );
}
}

add_action( ‘wpuf_add_post_after_insert’, ‘wpufe_copy_att_url’ );
add_action( ‘wpuf_edit_post_after_update’, ‘wpufe_copy_att_url’ );

September 8, 2013 at 11:58 am in reply to: custom field (image) not saved 7912
lwrkrol lwrkrol

But that is not what I want.

I want to select a file in my form and the path to the uploaded file should be stored in the meta field. So how to do this ?

September 6, 2013 at 1:18 am in reply to: custom field (image) not saved 7841
lwrkrol lwrkrol

I changed the field type to text and then it’s saved correctly so it must be related to the image field.

August 25, 2013 at 11:05 pm in reply to: Need help with wp_postmeta fields! 7485
lwrkrol lwrkrol This reply has been marked as private.
August 19, 2013 at 3:40 am in reply to: Need help with wp_postmeta fields! 7139
lwrkrol lwrkrol

I have 1 field : address which maps to custom field address, here comes the streetaddress.

Then I use the taxonomy location to select the city. The streetaddress gets in the address field ok but in the backend I have to click the “find address on map” button to get the coordinates.

When I use custom field location instead of address for the streetaddress it fills in the streetaddress in the GPS field.

So how do the gps coordinates get in the right spot to display automatically on the map.

Hope you understand my problem.

August 17, 2013 at 1:00 pm in reply to: Need help with wp_postmeta fields! 7057
lwrkrol lwrkrol

Ok, I put this script in the wpuf-functions.php and it works great. The only thing I can not figure out is how to get the gmaps info.

In the backend you enter the address like broadway, new york and then press the find address button and it finds the right location on the map.

I created a form with the following fields:

address –> metakey = address
city –> no meta key since I use the taxonomy Location

So how do I get the right coordinates when I save the item. I would like to combine address and city, calculate the coordinates and then save it in the meta field location.

I have also tried a field with metakey ‘address’ ad then enter broadway, new york but then I still have to press the button ‘find address’in the backend.

Hope you can help

Viewing 9 Topics - 1 through 9 (of 9 total)