Startseite › Toolset Professional Support › [Gelöst] Can I show a message before redirecting to a page?
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 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 |
Zeitzone des Unterstützers: Africa/Casablanca (GMT+01:00)
Verwandte Dokumentation:
Dieses Thema enthält 2 Antworten, hat 2 Stimmen.
Zuletzt aktualisiert von himanshuS vor 3 Jahre, 8 Monaten.
Assistiert von: Jamal.
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 - versteckter Link
Can I use it to make two actions happen?
First, show a message, and second redirect to a new page?
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?
My issue is resolved now. Thank you!