Posted: February 12, 2016 at 10:01 pm
|
Hi, I’ve seen a few threads on this topic, which point to using Poedit to update the Important Notice on the Thank You screen after people register. Before I try Poedit, I’m wondering if it’s possible to add a filter to my site specific plugin to make the change. I used a filter to change the pre-approval Important Notice in registration checkout, following these instructions: https://gist.github.com/lorenzocaum/28ccc3b92d38e1dbc046 Is there a similar filter for the Thank You page, or is Poedit the only way to do it? This is the text I want to change: The following Event(s) you have registered for do not require payment at this time and will not be billed for during this transaction. Billing will only occur after all attendees have been approved by the event organizer. You will be notified when your registration has been processed. If this is a free event, then no billing will occur. Thanks in advance! |
Hi Maria, Yes you can use a custom function within the Site Specific Plugin. You can use the function shown here: https://eventespresso.com/wiki/how-to-change-wording-with-poedit/#custom-function Yours would be something like this: function mycustom_filter_gettext( $translated, $original, $domain ) { // This is an array of original strings // and what they should be replaced with $strings = array( 'The following Event(s) you have registered for do not require payment at this time and will not be billed for during this transaction. Billing will only occur after all attendees have been approved by the event organizer. You will be notified when your registration has been processed. If this is a free event, then no billing will occur.' => 'YOUR CUSTOM TEXT HERE', // Add some more strings here ); // See if the current string is in the $strings array // If so, replace its translation if ( isset( $strings[$original] ) ) { // This accomplishes the same thing as __() // but without running it through the filter again $translations = get_translations_for_domain( $domain ); $translated = $translations->translate( $strings[$original] ); } return $translated; } add_filter( 'gettext', 'mycustom_filter_gettext', 10, 3 ); Note that you can continue to add strings to that same function if you want to change other strings. |
|
|
Thanks for your help with this! I am just about there but seem to be doing something wrong. This is exactly what I added to my site specific plugin: function mycustom_filter_gettext( $translated, $original, $domain ) { I got an error message saying “syntax error, unexpected end of file.” Should I change anything here? Do I need to add any of the code below the note that reads “See if the current string is in the $strings array”? That was a bit confusing. Thanks again, |
Hi Maria, Yes, you will need to copy and paste every line of the code that Tony shared with you. |
|
|
Ok, thanks. Is anything in here notes? Or I should include absolutely everything? The text from here down confused me: // See if the current string is in the $strings array If these are instructions, I’m not quite sure what to do. |
You should include everything. There are notes, but the one note that’s for you is the one that says “Add some more strings here”. |
|
|
It worked! Thanks so much to you both. |
You’re most welcome, Maria 🙂 |
|
The support post ‘Changing the "Important Notice" on the Thank You registration page’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.