Changeset 48715 for trunk/src/wp-admin/includes/credits.php
- Timestamp:
- 08/03/2020 12:51:22 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/credits.php
r47198 r48715 12 12 * 13 13 * @since 3.2.0 14 * @since 5.6.0 Added the `$version` and `$locale` parameters. 14 15 * 16 * @param string $version WordPress version. Defaults to the current version. 17 * @param string $locale WordPress locale. Defaults to the current user's locale. 15 18 * @return array|false A list of all of the contributors, or false on error. 16 19 */ 17 function wp_credits() { 18 // Include an unmodified $wp_version. 19 require ABSPATH . WPINC . '/version.php'; 20 function wp_credits( $version = '', $locale = '' ) { 21 if ( ! $version ) { 22 // Include an unmodified $wp_version. 23 require ABSPATH . WPINC . '/version.php'; 20 24 21 $locale = get_user_locale(); 25 $version = $wp_version; 26 } 27 28 if ( ! $locale ) { 29 $locale = get_user_locale(); 30 } 22 31 23 32 $results = get_site_transient( 'wordpress_credits_' . $locale ); 24 33 25 34 if ( ! is_array( $results ) 26 || false !== strpos( $ wp_version, '-' )27 || ( isset( $results['data']['version'] ) && strpos( $ wp_version, $results['data']['version'] ) !== 0 )35 || false !== strpos( $version, '-' ) 36 || ( isset( $results['data']['version'] ) && strpos( $version, $results['data']['version'] ) !== 0 ) 28 37 ) { 29 $url = "http://api.wordpress.org/core/credits/1.1/?version={$ wp_version}&locale={$locale}";30 $options = array( 'user-agent' => 'WordPress/' . $ wp_version . '; ' . home_url( '/' ) );38 $url = "http://api.wordpress.org/core/credits/1.1/?version={$version}&locale={$locale}"; 39 $options = array( 'user-agent' => 'WordPress/' . $version . '; ' . home_url( '/' ) ); 31 40 32 41 if ( wp_http_supports( array( 'ssl' ) ) ) {
Note: See TracChangeset
for help on using the changeset viewer.