wp/wp-admin/credits.php
changeset 5 5e2f62d02dcd
parent 0 d970ebf37754
child 7 cf61fcea0001
equal deleted inserted replaced
4:346c88efed21 5:5e2f62d02dcd
    16  *
    16  *
    17  * @global string $wp_version The current WordPress version.
    17  * @global string $wp_version The current WordPress version.
    18  *
    18  *
    19  * @since 3.2.0
    19  * @since 3.2.0
    20  *
    20  *
    21  * @return array A list of all of the contributors.
    21  * @return array|bool A list of all of the contributors, or false on error.
    22 */
    22 */
    23 function wp_credits() {
    23 function wp_credits() {
    24 	global $wp_version;
    24 	global $wp_version;
    25 	$locale = get_locale();
    25 	$locale = get_locale();
    26 
    26 
    27 	$results = get_site_transient( 'wordpress_credits_' . $locale );
    27 	$results = get_site_transient( 'wordpress_credits_' . $locale );
    28 
    28 
    29 	if ( ! is_array( $results )
    29 	if ( ! is_array( $results )
       
    30 		|| false !== strpos( $wp_version, '-' )
    30 		|| ( isset( $results['data']['version'] ) && strpos( $wp_version, $results['data']['version'] ) !== 0 )
    31 		|| ( isset( $results['data']['version'] ) && strpos( $wp_version, $results['data']['version'] ) !== 0 )
    31 	) {
    32 	) {
    32 		$response = wp_remote_get( "http://api.wordpress.org/core/credits/1.1/?version=$wp_version&locale=$locale" );
    33 		$response = wp_remote_get( "http://api.wordpress.org/core/credits/1.1/?version=$wp_version&locale=$locale" );
    33 
    34 
    34 		if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) )
    35 		if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) )
    50  *
    51  *
    51  * @access private
    52  * @access private
    52  * @since 3.2.0
    53  * @since 3.2.0
    53  *
    54  *
    54  * @param string &$display_name The contributor's display name, passed by reference.
    55  * @param string &$display_name The contributor's display name, passed by reference.
    55  * @param string $user_name     The contributor's username.
    56  * @param string $username      The contributor's username.
    56  * @param string $profiles      URL to the contributor's WordPress.org profile page.
    57  * @param string $profiles      URL to the contributor's WordPress.org profile page.
    57  * @return string A contributor's display name, hyperlinked to a WordPress.org profile page.
    58  * @return string A contributor's display name, hyperlinked to a WordPress.org profile page.
    58  */
    59  */
    59 function _wp_credits_add_profile_link( &$display_name, $username, $profiles ) {
    60 function _wp_credits_add_profile_link( &$display_name, $username, $profiles ) {
    60 	$display_name = '<a href="' . esc_url( sprintf( $profiles, $username ) ) . '">' . esc_html( $display_name ) . '</a>';
    61 	$display_name = '<a href="' . esc_url( sprintf( $profiles, $username ) ) . '">' . esc_html( $display_name ) . '</a>';
    79 ?>
    80 ?>
    80 <div class="wrap about-wrap">
    81 <div class="wrap about-wrap">
    81 
    82 
    82 <h1><?php printf( __( 'Welcome to WordPress %s' ), $display_version ); ?></h1>
    83 <h1><?php printf( __( 'Welcome to WordPress %s' ), $display_version ); ?></h1>
    83 
    84 
    84 <div class="about-text"><?php echo str_replace( '3.7', $display_version, __( 'Thank you for updating to WordPress 3.7! You might not notice a thing, and we&#8217;re okay with that.' ) ); ?></div>
    85 <div class="about-text"><?php printf( __( 'Thank you for updating! WordPress %s helps you communicate and share, globally.' ), $display_version ); ?></div>
    85 
    86 
    86 <div class="wp-badge"><?php printf( __( 'Version %s' ), $display_version ); ?></div>
    87 <div class="wp-badge"><?php printf( __( 'Version %s' ), $display_version ); ?></div>
    87 
    88 
    88 <h2 class="nav-tab-wrapper">
    89 <h2 class="nav-tab-wrapper">
    89 	<a href="about.php" class="nav-tab">
    90 	<a href="about.php" class="nav-tab">
    99 
   100 
   100 $credits = wp_credits();
   101 $credits = wp_credits();
   101 
   102 
   102 if ( ! $credits ) {
   103 if ( ! $credits ) {
   103 	echo '<p class="about-description">' . 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>.' ),
   104 	echo '<p class="about-description">' . 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>.' ),
   104 		'http://wordpress.org/about/',
   105 		'https://wordpress.org/about/',
   105 		/* translators: Url to the codex documentation on contributing to WordPress used on the credits page */
   106 		/* translators: Url to the codex documentation on contributing to WordPress used on the credits page */
   106 		__( 'http://codex.wordpress.org/Contributing_to_WordPress' ) ) . '</p>';
   107 		__( 'https://codex.wordpress.org/Contributing_to_WordPress' ) ) . '</p>';
   107 	include( ABSPATH . 'wp-admin/admin-footer.php' );
   108 	include( ABSPATH . 'wp-admin/admin-footer.php' );
   108 	exit;
   109 	exit;
   109 }
   110 }
   110 
   111 
   111 echo '<p class="about-description">' . __( 'WordPress is created by a worldwide team of passionate individuals.' ) . "</p>\n";
   112 echo '<p class="about-description">' . __( 'WordPress is created by a worldwide team of passionate individuals.' ) . "</p>\n";
   144 			echo '<ul class="' . $classes . '" id="wp-people-group-' . $group_slug . '">' . "\n";
   145 			echo '<ul class="' . $classes . '" id="wp-people-group-' . $group_slug . '">' . "\n";
   145 			foreach ( $group_data['data'] as $person_data ) {
   146 			foreach ( $group_data['data'] as $person_data ) {
   146 				echo '<li class="wp-person" id="wp-person-' . $person_data[2] . '">' . "\n\t";
   147 				echo '<li class="wp-person" id="wp-person-' . $person_data[2] . '">' . "\n\t";
   147 				echo '<a href="' . sprintf( $credits['data']['profiles'], $person_data[2] ) . '">';
   148 				echo '<a href="' . sprintf( $credits['data']['profiles'], $person_data[2] ) . '">';
   148 				$size = 'compact' == $group_data['type'] ? '30' : '60';
   149 				$size = 'compact' == $group_data['type'] ? '30' : '60';
   149 				echo '<img src="' . $gravatar . $person_data[1] . '?s=' . $size . '" class="gravatar" alt="' . esc_attr( $person_data[0] ) . '" /></a>' . "\n\t";
   150 				echo '<img src="' . $gravatar . $person_data[1] . '?s=' . $size . '" srcset="' . $gravatar . $person_data[1] . '?s=' . $size * 2 . ' 2x" class="gravatar" alt="' . esc_attr( $person_data[0] ) . '" /></a>' . "\n\t";
   150 				echo '<a class="web" href="' . sprintf( $credits['data']['profiles'], $person_data[2] ) . '">' . $person_data[0] . "</a>\n\t";
   151 				echo '<a class="web" href="' . sprintf( $credits['data']['profiles'], $person_data[2] ) . '">' . $person_data[0] . "</a>\n\t";
   151 				if ( ! $compact )
   152 				if ( ! $compact )
   152 					echo '<span class="title">' . translate( $person_data[3] ) . "</span>\n";
   153 					echo '<span class="title">' . translate( $person_data[3] ) . "</span>\n";
   153 				echo "</li>\n";
   154 				echo "</li>\n";
   154 			}
   155 			}
   157 	}
   158 	}
   158 }
   159 }
   159 
   160 
   160 ?>
   161 ?>
   161 <p class="clear"><?php printf( __( 'Want to see your name in lights on this page? <a href="%s">Get involved in WordPress</a>.' ),
   162 <p class="clear"><?php printf( __( 'Want to see your name in lights on this page? <a href="%s">Get involved in WordPress</a>.' ),
   162 	/* translators: Url to the codex documentation on contributing to WordPress used on the credits page */
   163 	/* translators: URL to the Make WordPress 'Get Involved' landing page used on the credits page */
   163 	__( 'http://codex.wordpress.org/Contributing_to_WordPress' ) ); ?></p>
   164 	__( 'https://make.wordpress.org/' ) ); ?></p>
   164 
   165 
   165 </div>
   166 </div>
   166 <?php
   167 <?php
   167 
   168 
   168 include( ABSPATH . 'wp-admin/admin-footer.php' );
   169 include( ABSPATH . 'wp-admin/admin-footer.php' );
   176 __( 'Recent Rockstars' );
   177 __( 'Recent Rockstars' );
   177 __( 'Core Contributors to WordPress %s' );
   178 __( 'Core Contributors to WordPress %s' );
   178 __( 'Contributing Developers' );
   179 __( 'Contributing Developers' );
   179 __( 'Cofounder, Project Lead' );
   180 __( 'Cofounder, Project Lead' );
   180 __( 'Lead Developer' );
   181 __( 'Lead Developer' );
       
   182 __( 'Release Lead' );
   181 __( 'User Experience Lead' );
   183 __( 'User Experience Lead' );
   182 __( 'Core Developer' );
   184 __( 'Core Developer' );
   183 __( 'Core Committer' );
   185 __( 'Core Committer' );
   184 __( 'Guest Committer' );
   186 __( 'Guest Committer' );
   185 __( 'Developer' );
   187 __( 'Developer' );