WordPress.org

Make WordPress Core

Ticket #35910: 35910.patch

File 35910.patch, 1.4 KB (added by ramiy, 6 years ago)
  • wp-admin/includes/credits.php

     
    1414 *
    1515 * @since 3.2.0
    1616 *
     17 * @param string $version WordPress version. Default is the current version.
     18 * @param string $locale WordPress locale. Default is the current locale.
    1719 * @return array|false A list of all of the contributors, or false on error.
    1820 */
    19 function wp_credits() {
     21function wp_credits( $version, $locale ) {
    2022        global $wp_version;
    21         $locale = get_locale();
    2223
     24        if ( ! $version ) {
     25                $version = $wp_version;
     26        }
     27        if ( ! $locale ) {
     28                $locale = get_locale();
     29        }
     30
    2331        $results = get_site_transient( 'wordpress_credits_' . $locale );
    2432
    2533        if ( ! is_array( $results )
    26                 || false !== strpos( $wp_version, '-' )
    27                 || ( isset( $results['data']['version'] ) && strpos( $wp_version, $results['data']['version'] ) !== 0 )
     34                || false !== strpos( $version, '-' )
     35                || ( isset( $results['data']['version'] ) && strpos( $version, $results['data']['version'] ) !== 0 )
    2836        ) {
    29                 $response = wp_remote_get( "http://api.wordpress.org/core/credits/1.1/?version=$wp_version&locale=$locale" );
     37                $response = wp_remote_get( "http://api.wordpress.org/core/credits/1.1/?version=$version&locale=$locale" );
    3038
    3139                if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) )
    3240                        return false;