将PHP $文本转换为前端的可点击URL链接

时间:2016-11-25 10:08:17

标签: php wordpress woocommerce

我已经在WordPress的functions.php文件中添加了一个脚本,以便在Woocommerce Thank-You页面中生成其他文本。

 **
* 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;
}

部分文字是指向其他网页的链接。

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

但是,该链接不会在前端显示为突出显示/可点击的URL。我该如何解决这个问题?

3 个答案:

答案 0 :(得分:0)

使用PHP字符串中的链接: $new = $text . ' A receipt has been sent to you via email.Please submit your ticket <a href="https://google.com">here</a>';

答案 1 :(得分:-1)

试试这个

 **
* 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 <a href="https://google.com">here</a>';
return $new;
}

答案 2 :(得分:-2)

$new = $text . ' A receipt has been sent to you via email.Please submit your ticket <a href="https://google.com">here (https://google.com)</a>';
return $new;
相关问题