I've no clue if what I want is possible so a "no is not possible" could also be an answer for me.
Im making a PHP function like this:
<?php
function set_block_title($post){
echo "<p class='title'>$post->get_title()</p>";
}
I would like to do this without an echo and instead get the html out of the PHP page (mainly because the designers who will break all the PHP when they don't have the HTML syntax).
I know it's possible with an if statement like this:
<?php if( condition ): ?>
<p class='title'>
<?php echo $post->get_title(); ?>
</p>
<?php endif; ?>
Is there a way to do the same thing with a PHP function? I suppose I could do something like this:
<?php
function set_block_title($post){
<?php if( true ): ?>
<p class='title'>
<?php echo $post->get_title(); ?>
</p>
<?php endif;
}?>