Eliminate use of extract() in wp_widget_rss_output().

Add `'items' => 0` to `$default_args`. When `0`, the value is set to `10` (the fallback). 
Every other default arg has a default value of `0`.

`items` is expected to always be passed to this function.

See #22400.

Built from https://develop.svn.wordpress.org/trunk@28440


git-svn-id: http://core.svn.wordpress.org/trunk@28267 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2014-05-15 19:42:13 +00:00
parent 157f811a5e
commit 6e8e30bb1e

View File

@ -1016,16 +1016,15 @@ function wp_widget_rss_output( $rss, $args = array() ) {
return; return;
} }
$default_args = array( 'show_author' => 0, 'show_date' => 0, 'show_summary' => 0 ); $default_args = array( 'show_author' => 0, 'show_date' => 0, 'show_summary' => 0, 'items' => 0 );
$args = wp_parse_args( $args, $default_args ); $args = wp_parse_args( $args, $default_args );
extract( $args, EXTR_SKIP );
$items = (int) $items; $items = (int) $args['items'];
if ( $items < 1 || 20 < $items ) if ( $items < 1 || 20 < $items )
$items = 10; $items = 10;
$show_summary = (int) $show_summary; $show_summary = (int) $args['show_summary'];
$show_author = (int) $show_author; $show_author = (int) $args['show_author'];
$show_date = (int) $show_date; $show_date = (int) $args['show_date'];
if ( !$rss->get_item_quantity() ) { if ( !$rss->get_item_quantity() ) {
echo '<ul><li>' . __( 'An error has occurred, which probably means the feed is down. Try again later.' ) . '</li></ul>'; echo '<ul><li>' . __( 'An error has occurred, which probably means the feed is down. Try again later.' ) . '</li></ul>';