Skip Navigation

[Resolved] The custom function stores the data in askii instead of unicode

This topic contains 0 reply, has 1 voice.

Last updated by fabriceS 1 year, 4 months ago.

Assisted by: Christopher Amirian.

Author
Posts
#2680753

I used a script War gave me, but the result display special character in their ascii form
Here is the script

add_action('cred_save_data', 'custom_save_form_container',10,2);
function custom_save_form_container($post_id, $form_data)
{
// if a specific form
if ($form_data['id']==12345)
{
// if form container ID is set
if (isset($_POST['_cred_cred_prefix_cred_container_id']))
{
// get the title of the container ID
$container_title = get_the_title($_POST['_cred_cred_prefix_cred_container_id']);
// add it to saved post's target custom field
add_post_meta($post_id, 'wpcf-form-submitted-from', $container_title, true);
}
}
}