[wp-trac] [WordPress Trac] #18704: WP_Widget_RSS widget outputs error if 0 posts found in feed. Should output "No posts found"
WordPress Trac
wp-trac at lists.automattic.com
Mon Sep 19 15:54:25 UTC 2011
#18704: WP_Widget_RSS widget outputs error if 0 posts found in feed. Should output
"No posts found"
--------------------------+------------------------------------
Reporter: ericlewis | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Widgets | Version: 3.2.1
Severity: normal | Keywords: has-patch dev-feedback
--------------------------+------------------------------------
The output function for WP_Widget_RSS does a conditional check to see if
the feed has returned an error, by checking if $rss->get_item_quantity()
returns false. If it does return false the output says "An error
occurred," which may not be true if the feed just has no posts yet.
This can be remedied by changing the conditional as I have, to check if
$rss->get_item_quantity() is identical to false, so if the method
get_item_quantity returns 0 an alternate else if will output "No posts
found."
--
Ticket URL: <http://core.trac.wordpress.org/ticket/18704>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list