I have emebed a cred form in a single post that should create secondary languages (not finished yet).. what i am trying to do is , when user submit the embed form will be redirected to an edit form. like foloowing:
1- user click on the embed form button "create English"
2- user get to the redirected to an edit form specified in a cred redirection hook.
i tried following but its not working
/** Redirect Add Russian - Button Form **/
add_filter('cred_success_redirect', 'custom_redirect',10,3);
function custom_redirect($url, $post_id, $form_data)
{
global $post;
$post_slug=$post->post_name;
$layout_slug='?layout_id=46';
//create an array of values with all ID's of the Forms you want to check:
$ids = array("49","51");
//Check if the current form ID is one of in the above array:
if (in_array($form_data['id'], $ids) ){
return '<em><u>hidden link</u></em>;?php echo $post_slug; ?>';
return $url;
}
}
Without getting into the details of what you are aiming to achieve, you have incorrectly formed PHP code, guessing your intent the final part should look something like this: