using echo when filtering the_content
-
Is it a sin, or at least bad practice, to use “echo” in a function that has been added as a filter on “the_content” ?
function myFunc($content) { echo "This gets printed first"; return $content; } add_filter ('the_content', 'myFunc');Or is the only accepted way to modify the incoming content string:
function myFunc($content) { $content = "This gets printed first".$content; return content; } add_filter ('the_content', 'myFunc');?
The topic ‘using echo when filtering the_content’ is closed to new replies.