Support

Home Forums Event Espresso Premium Add html to a replaced string

Add html to a replaced string

Posted: April 11, 2024 at 7:11 am


Gorkem

April 11, 2024 at 7:11 am

I’m trying to replace the text on the Thank You screen, using this:
https://gist.github.com/Pebblo/7c7c760f5f5e00863c06

It works absolutely fine for plain text but i am trying to add a bold tag to one part of text and also add in a link.

I’ve searched quite a bit and i can’t find a way to do this. It simply outputs the actual html tags as words on the screen. Is there a way i can add the bold tag and link to this copy?


Sam

  • Support Staff

April 11, 2024 at 10:50 am

Hi There,

In the attached git file above, you can find and replace this code:

$strings = array(
        '%1$sCongratulations%2$sYour registration has been successfully processed.%3$sCheck your email for your registration confirmation or click the button below to view / download / print a full description of your purchases and registration information.' => 'Thank you for submitting payment. Your order has been successfully completed. It is important for you to complete the TEAM REGISTRATION form if you are playing in the croquet tournament. Click the button below to visit the registration form.',
        // Add some more strings here
    );

With this:

 $strings = array(
        '%1$sCongratulations%2$sYour registration has been successfully processed.%3$sCheck your email for your registration confirmation or click the button below to view / download / print a full description of your purchases and registration information.' => 'Thank you for submitting payment. Your order has been <strong>successfully completed</strong>. It is important for you to complete the <strong><a href="YOUR_LINK_HERE">TEAM REGISTRATION form</a></strong> if you are playing in the croquet tournament. Click the button below to visit the registration form.',
        // Add some more strings here
    );

Here you can adjust the text within the strong tag and link as per your requirement.

Hope that helps.


Rio

  • Support Staff

April 12, 2024 at 7:48 am

That is using gettext hook. https://developer.wordpress.org/reference/hooks/gettext/

You can have different approach by using this hooks and actions. Check this article here
https://eventespresso.com/wiki/ee4-thank-page-actions-filters-hooks/


add_filter( 'FHEE__thank_you_page_overview_template__order_conf_desc', 'ee_change_thank_you_page_congratulations_messaging' );
function ee_change_thank_you_page_congratulations_messaging() {
 return '<b>Your</b> registration has been received! View your registration details by scrolling down.';
}

thanks


Gorkem

April 12, 2024 at 8:11 am

Hi Rio,

Excellent, thank you!
That did the trick perfectly.


Sam

  • Support Staff

April 12, 2024 at 8:18 am

We are glad you got that working now. Please feel free to ask if you have any other questions.

The support post ‘Add html to a replaced string’ 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.

Event Espresso