Make WordPress Core


Ignore:
Timestamp:
05/15/2014 02:56:56 AM (9 years ago)
Author:
wonderboymusic
Message:

Eliminate use of extract() in wp_star_rating().

See #22400.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/template.php

    r28107 r28409  
    20712071    );
    20722072    $r = wp_parse_args( $args, $defaults );
    2073     extract( $r, EXTR_SKIP );
    20742073
    20752074    // Non-english decimal places when the $rating is coming from a string
    2076     $rating = str_replace( ',', '.', $rating );
     2075    $rating = str_replace( ',', '.', $r['rating'] );
    20772076
    20782077    // Convert Percentage to star rating, 0..5 in .5 increments
    2079     if ( 'percent' == $type ) {
     2078    if ( 'percent' == $r['type'] ) {
    20802079        $rating = round( $rating / 10, 0 ) / 2;
    20812080    }
     
    20862085    $empty_stars = 5 - $full_stars - $half_stars;
    20872086
    2088     if ( $number ) {
     2087    if ( $r['number'] ) {
    20892088        /* translators: 1: The rating, 2: The number of ratings */
    2090         $title = _n( '%1$s rating based on %2$s rating', '%1$s rating based on %2$s ratings', $number );
    2091         $title = sprintf( $title, number_format_i18n( $rating, 1 ), number_format_i18n( $number ) );
     2089        $format = _n( '%1$s rating based on %2$s rating', '%1$s rating based on %2$s ratings', $r['number'] );
     2090        $title = sprintf( $format, number_format_i18n( $rating, 1 ), number_format_i18n( $r['number'] ) );
    20922091    } else {
    20932092        /* translators: 1: The rating */
Note: See TracChangeset for help on using the changeset viewer.