Make WordPress Core


Ignore:
Timestamp:
05/15/2014 07:41:41 PM (9 years ago)
Author:
wonderboymusic
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/default-widgets.php

    r28439 r28440  
    10171017    }
    10181018
    1019     $default_args = array( 'show_author' => 0, 'show_date' => 0, 'show_summary' => 0 );
     1019    $default_args = array( 'show_author' => 0, 'show_date' => 0, 'show_summary' => 0, 'items' => 0 );
    10201020    $args = wp_parse_args( $args, $default_args );
    1021     extract( $args, EXTR_SKIP );
    1022 
    1023     $items = (int) $items;
     1021
     1022    $items = (int) $args['items'];
    10241023    if ( $items < 1 || 20 < $items )
    10251024        $items = 10;
    1026     $show_summary  = (int) $show_summary;
    1027     $show_author   = (int) $show_author;
    1028     $show_date     = (int) $show_date;
     1025    $show_summary  = (int) $args['show_summary'];
     1026    $show_author   = (int) $args['show_author'];
     1027    $show_date     = (int) $args['show_date'];
    10291028
    10301029    if ( !$rss->get_item_quantity() ) {
Note: See TracChangeset for help on using the changeset viewer.