Gavin Reynoldson Gavin Reynoldson - 13 days ago 5
PHP Question

Convert PHP $text into clickable url link on frontend

I have added a script to my functions.php file in WordPress to generate additional text in the Woocommerce Thank-You page.

**
* Custom text on the receipt page.
*/
function isa_order_received_text( $text, $order ) {
$new = $text . ' A receipt has been sent to you via email.Please submit your ticket here:https://google.com';
return $new;
}


Part of the text is a link to another page.

Please submit your ticket here:https://google.com';


However, the link does not display as a highlighted/clickable URL on the frontend. How do I fix this?

Max Max
Answer

Use a link inside your PHP string : $new = $text . ' A receipt has been sent to you via email.Please submit your ticket <a href="https://google.com">here</a>';