Post Author Box v1.2: Template tag

Boone and I are hiding and coding today. It’s been far too long since I’ve committed any open source code, so I’m catching up on the numerous promises I’ve made in the last couple of months.

First up, a template tag for Post Author Box. Simply add post_author_box(); to any loop within your WordPress theme and it will automatically display a post author box based on the display configuration in settings. Alternatively, you can pass a custom display configuration in the form of HTML and tokens. Thanks to Uche for the request.

Tagged and available for download in the WordPress.org plugin directory. As always, leave questions, bug reports, and feature requests in the support forum.

3 Comments

Uche May 19, 2011 Reply

Thanks for getting this done! Superb

Andrew Nacin May 19, 2011 Reply

Plugin-derived template tags are kind of lame – what about suggesting it as a hook instead?

Adding this to your theme will ensure your theme doesn’t explode the moment your plugin is deactivated: do_action( 'post_author_box' );.

Now all you need to do is add add_action( 'post_author_box', 'post_author_box' ); to your plugin. Best of all, your template tag still works, for those inclined.

Further reading.

Daniel Bachhuber May 19, 2011 Reply

Great recommendation, thanks. Not worth it for what I just did but I’ll definitely consider it in the future.

Leave a Reply