659 posts
  • 8 Years of Membership
  • Affiliate Level 3
  • Collector Level 2
  • Exclusive Author
+3 more

I asked this question over in the actual tut, but not sure I’ll get an answer anytime soon as it’s almost 2 months old… so I’ll take a gander here…

Tut is here: Build a WordPress Plugin to Add Author Biographies to your Posts

To sum up the tut and what the problem is, The tut adds an Author Bio on to the end of the content like so (the short version):

function x($content) {
     return $content . "Author Bio";


The Problem:

When someone uses:
$z = apply_filters('the_content', 'some content here');
echo $z;

The Author Bio will end up applied to $z and if $z is echoed out in the middle of some page… the Author Bio would be in the middle of some page… correct? (it’s correct because I’ve tested it…)

Is there a better way to apply something to the end/under/below the_content hook? other than add_action(‘the_content’, ‘some_function’) because this to me seems evil…

or is apply_filters(‘the_content’, ‘some content here’) not the norm or something developers shouldn’t be using inside their WordPress templates…? (which seems pretty much the norm, at least upon Google-ing formatting “the_content” outside the loop)...