Quantcast
Viewing all articles
Browse latest Browse all 20145

CRED Submit Complete

Hi everyone, I was trying to use one of the examples listed http://wp-types.com/documentation/user-guides/cred-api/

I have a CRED form with form ID 1335 that creates a new post and wanted to use a custom action after the post is submitted and created…I plugged in the below code in my functions.php file in my theme and I get a blank page. Can't see the error. Anyone know what I'm possibly doing wrong?

Thank you.

////////////////////////
add_action(‘cred_submit_complete’, ’my_success_action’,10,2);
function my_success_action($post_id, $form_data)
{
// if a specific form
if ($form_data[‘id’]==1335)

{

// user can overwrite everything here, eg redirection, messages displayed etc..

// eg redirect regardless of form settings

header(‘location:success.php’);

}
}
//////////////////////


Viewing all articles
Browse latest Browse all 20145

Trending Articles