Skip Navigation

[Resolved] Can I show a message before redirecting to a page?

This thread is resolved. Here is a description of the problem and solution.

Problem:
The user would like to customize the success message in a form before the page is redirected.

Solution:
This will require custom code snippet to customize the message that would be displayed before the redirect. Something like:

add_filter('gettext', function($translated_text, $untranslated_text, $domain){
    if($untranslated_text == 'Please Wait. You are being redirected...' && $domain == 'wp-cred'){
        $translated_text = 'The new message to display before the redirect';
    }
    return $translated_text;
}, 10, 3);

Note that the message will be wrapped in a

tag, this means that you can't use any HTML tags, only the ones that can be wrapped in a

tag.

This support ticket is created 3 years, 2 months ago. 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
9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - - 9: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: Africa/Casablanca (GMT+01:00)

This topic contains 2 replies, has 2 voices.

Last updated by himanshuS 3 years, 1 month ago.

Assisted by: Jamal.

Author
Posts
#2225159

I have a registration form submission using AJAX. I want to redirect the user to a new page on form submit... which happens just fine but I do that I want to show a brief message. I see there is a delay functionality in CRED - hidden link

Can I use it to make two actions happen?
First, show a message, and second redirect to a new page?

#2226055

Hello and thank you for contacting the Toolset support.

I believe you can achieve that with a custom code snippet to customize the message that would be displayed before the redirect. Something like:

add_filter('gettext', function($translated_text, $untranslated_text, $domain){
    if($untranslated_text == 'Please Wait. You are being redirected...' && $domain == 'wp-cred'){
        $translated_text = 'The new message to display before the redirect';
    }
    return $translated_text;
}, 10, 3);

Please note that the message will be wrapped in a <p> tag, this means that you can't use any HTML tags, only the ones that can be wrapped in a <p> tag. Does it make sense?

#2226335

My issue is resolved now. Thank you!