Fixed error in tag listing. March 7, 2008

Just fixed an error in a foreach() call in the new jwr_show_tags() function in Squible’s wp_cats_as_tags(). Turns out that, for unknown reasons, the old implementation would barf when it saw a post without any tags, when get_the_tags() returned an empty list. Thanks to the examples described here, I’m using an if() to bail out of the function:

if (empty($posttags)) echo "";
else
foreach

The old way to do this was to throw a break at the end of the function using an if() to check the size of the list:

if ( $displaycount == $limit) {break;}

Anyway, it works now.

Article printed from 2097 Test Drive: http://www.2097racing.com/wordpress
URL to article: http://www.2097racing.com/wordpress/2008/03/07/fixed-error-in-tag-listing/

Post Tags
Conversation
Related Tags
Comments
Trackback


Leave a Reply

This entry was posted on Friday, March 7th, 2008 at 6:18 pm. You can follow any responses to this entry through the RSS 2.0 feed. If you're wondering how to get your own icon next to your comment, go visit gravatar.com and get yourself hooked up.
2097 Test Drive is proudly powered by Wordpress 2.3.3 and Squible Beta 2.
All content is copyrighted by its author[s].