Saltar navegación

[Resuelto] After CRED submit redirect to a custom url with target blank

This support ticket is created hace 4 años, 8 meses. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

Este tema contiene 2 respuestas, tiene 2 mensajes.

Última actualización por Lara hace 4 años, 8 meses.

Asistido por: Minesh.

Autor
Mensajes
#1601743

Tell us what you are trying to do?

After I submit the CRED form, the customer should be redirected to a custom url with traget='_blank'

add_filter('cred_success_redirect', 'custom_redirect',10,3);
function custom_redirect($url, $post_id, $form_data)
{
    if ($form_data['id']==785)
        return '<em><u>enlace oculto</u></em>'; 

   
    return $url;
}

The code works fine. After the CRED form is submitted, the user will be redirected to enlace oculto
My question: Is there a way to open enlace oculto in a new window with traget='_blank' ?

Is there any documentation that you are following?
https://toolset.com/forums/topic/allow-redirect-to-specific-link-or-custom-post-type/

Is there a similar example that we can see?
See documentation

What is the link to your site?
enlace oculto

#1602321

Minesh
Supporter

Idiomas: Inglés (English )

Zona horaria: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

No, there is no such feature available to redirect the page on the new window or tab as redirection is supposed to happen on the same window.

You may try to use the window.open() on your own if that help you to resolve your issue.
=> https://stackoverflow.com/questions/19851782/how-to-open-a-url-in-a-new-tab-using-javascript-or-jquery

#1602769

Many thanks Minesh.