There are two workarounds:
If the first line you’re mentioning is inside a void function:
You have to create a wrapper function and use ob_
functions to get the real link:
<?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()";
By the way, You might forget about those dots (.
) while trying to concatenate your strings.