有两种解决方法:
If the first line you\'re mentioning is inside a void function:
您必须创建包装器函数并使用
ob_
获取真实链接的函数:
<?php
function echo_link($post, $landing_page) {
global $myfy;
echo $myfy->get_retrieve_cart_url( $post->ID, $landing_page );
}
function get_link($post, $landing_page){
ob_start();
echo_link($post, $landing_page);
return ob_get_clean();
}
// And finally in your result:
echo "a href=\'" . get_link($post, $landing_page) . "\'>.get_title()";
If the first line you\'re mentioning is not inside a void function or you can simply duplicate it without concerning about the future changes:
<?php
$link = $myfy->get_retrieve_cart_url( $post->ID, $landing_page );
echo "a href=\'" . $link . "\'>.get_title()";
顺便说一下,你可能忘了那些点(
.
) 尝试连接字符串时。