Changeset 18001
- Timestamp:
- 05/23/2011 12:08:51 AM (15 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/credits.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/credits.php
r17980 r18001 28 28 $locale = get_locale(); 29 29 30 $results = get_site_transient( 'wordpress_credits ');30 $results = get_site_transient( 'wordpress_credits_' . $locale ); 31 31 32 if ( ! is_array( $results ) || !isset( $results['people'] ) ) {32 if ( ! is_array( $results ) || ! isset( $results['people'] ) || ! isset( $results['lists'] ) ) { 33 33 $response = wp_remote_get( "http://api.wordpress.org/core/credits/1.0/?version=$wp_version&locale=$locale" ); 34 34 … … 38 38 $results = unserialize( wp_remote_retrieve_body( $response ) ); 39 39 40 if ( ! is_array( $results ) )40 if ( ! is_array( $results ) ) 41 41 return false; 42 42 43 set_site_transient( 'wordpress_credits ', $results, 604800 ); // One week.43 set_site_transient( 'wordpress_credits_' . $locale, $results, 86400 ); // @todo Set to one week. 44 44 } 45 45 … … 61 61 $results = wp_credits(); 62 62 63 if ( ! isset( $results['people'] )) {63 if ( ! $results ) { 64 64 echo '<p>' . sprintf( __( 'WordPress is created by a <a href="%1$s">worldwide team</a> of passionate individuals. <a href="%2$s">Get involved in WordPress</a>.' ), 65 65 'http://wordpress.org/about/', … … 86 86 } 87 87 88 if ( isset( $results['props'] ) ) { 89 echo '<h3 class="wp-props-group">' . sprintf( translate( $results['groups']['props'] ), $results['data']['version'] ) . "</h3>\n\n"; 90 array_walk( $results['props'], '_wp_credits_add_profile_link', $results['data']['profile_prefix'] ); 91 shuffle( $results['props'] ); 92 echo wp_sprintf( '%l.', $results['props'] ); 88 foreach ( (array) $results['lists'] as $group_slug => $members ) { 89 $title = translate( $results['groups'][ $group_slug ] ); 90 if ( isset( $results['data']['placeholders'][ $group_slug ] ) ) 91 $title = vsprintf( $title, $results['data']['placeholders'][ $group_slug ] ); 92 echo '<h3 class="wp-props-group">' . $title . "</h3>\n\n"; 93 array_walk( $members, '_wp_credits_add_profile_link', $results['data']['profile_prefix'] ); 94 shuffle( $members ); 95 echo wp_sprintf( '%l.', $members ); 93 96 } 94 97 … … 108 111 __( 'Recent Rockstars' ); 109 112 __( 'Core Contributors to WordPress %s' ); 113 __( 'Translators for %s' ); 110 114 __( 'Cofounder, Project Lead' ); 111 115 __( 'Lead Developer' ); … … 116 120 __( 'XML-RPC Developer' ); 117 121 __( 'Internationalization' ); 122 __( 'Twenty Eleven' ); 118 123 119 124 ?>
Note: See TracChangeset
for help on using the changeset viewer.