3 * Credits administration panel.
6 * @subpackage Administration
9 /** WordPress Administration Bootstrap */
10 require_once( dirname( __FILE__ ) . '/admin.php' );
12 $title = __( 'Credits' );
15 * Retrieve the contributor credits.
17 * @global string $wp_version The current WordPress version.
21 * @return array|bool A list of all of the contributors, or false on error.
23 function wp_credits() {
25 $locale = get_locale();
27 $results = get_site_transient( 'wordpress_credits_' . $locale );
29 if ( ! is_array( $results )
30 || false !== strpos( $wp_version, '-' )
31 || ( isset( $results['data']['version'] ) && strpos( $wp_version, $results['data']['version'] ) !== 0 )
33 $response = wp_remote_get( "http://api.wordpress.org/core/credits/1.1/?version=$wp_version&locale=$locale" );
35 if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) )
38 $results = json_decode( wp_remote_retrieve_body( $response ), true );
40 if ( ! is_array( $results ) )
43 set_site_transient( 'wordpress_credits_' . $locale, $results, DAY_IN_SECONDS );
50 * Retrieve the link to a contributor's WordPress.org profile page.
55 * @param string &$display_name The contributor's display name, passed by reference.
56 * @param string $username The contributor's username.
57 * @param string $profiles URL to the contributor's WordPress.org profile page.
58 * @return string A contributor's display name, hyperlinked to a WordPress.org profile page.
60 function _wp_credits_add_profile_link( &$display_name, $username, $profiles ) {
61 $display_name = '<a href="' . esc_url( sprintf( $profiles, $username ) ) . '">' . esc_html( $display_name ) . '</a>';
65 * Retrieve the link to an external library used in WordPress.
70 * @param string &$data External library data, passed by reference.
71 * @return string Link to the external library.
73 function _wp_credits_build_object_link( &$data ) {
74 $data = '<a href="' . esc_url( $data[1] ) . '">' . $data[0] . '</a>';
77 list( $display_version ) = explode( '-', $wp_version );
79 include( ABSPATH . 'wp-admin/admin-header.php' );
81 <div class="wrap about-wrap">
83 <h1><?php printf( __( 'Welcome to WordPress %s' ), $display_version ); ?></h1>
85 <div class="about-text"><?php printf( __( 'Thank you for updating! WordPress %s helps you focus on your writing, and the new default theme lets you show it off in style.' ), $display_version ); ?></div>
87 <div class="wp-badge"><?php printf( __( 'Version %s' ), $display_version ); ?></div>
89 <h2 class="nav-tab-wrapper">
90 <a href="about.php" class="nav-tab">
91 <?php _e( 'What’s New' ); ?>
92 </a><a href="credits.php" class="nav-tab nav-tab-active">
93 <?php _e( 'Credits' ); ?>
94 </a><a href="freedoms.php" class="nav-tab">
95 <?php _e( 'Freedoms' ); ?>
101 $credits = wp_credits();
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>.' ),
105 'https://wordpress.org/about/',
106 /* translators: Url to the codex documentation on contributing to WordPress used on the credits page */
107 __( 'http://codex.wordpress.org/Contributing_to_WordPress' ) ) . '</p>';
108 include( ABSPATH . 'wp-admin/admin-footer.php' );
112 echo '<p class="about-description">' . __( 'WordPress is created by a worldwide team of passionate individuals.' ) . "</p>\n";
114 $gravatar = is_ssl() ? 'https://secure.gravatar.com/avatar/' : 'http://0.gravatar.com/avatar/';
116 foreach ( $credits['groups'] as $group_slug => $group_data ) {
117 if ( $group_data['name'] ) {
118 if ( 'Translators' == $group_data['name'] ) {
119 // Considered a special slug in the API response. (Also, will never be returned for en_US.)
120 $title = _x( 'Translators', 'Translate this to be the equivalent of English Translators in your language for the credits page Translators section' );
121 } elseif ( isset( $group_data['placeholders'] ) ) {
122 $title = vsprintf( translate( $group_data['name'] ), $group_data['placeholders'] );
124 $title = translate( $group_data['name'] );
127 echo '<h4 class="wp-people-group">' . $title . "</h4>\n";
130 if ( ! empty( $group_data['shuffle'] ) )
131 shuffle( $group_data['data'] ); // We were going to sort by ability to pronounce "hierarchical," but that wouldn't be fair to Matt.
133 switch ( $group_data['type'] ) {
135 array_walk( $group_data['data'], '_wp_credits_add_profile_link', $credits['data']['profiles'] );
136 echo '<p class="wp-credits-list">' . wp_sprintf( '%l.', $group_data['data'] ) . "</p>\n\n";
139 array_walk( $group_data['data'], '_wp_credits_build_object_link' );
140 echo '<p class="wp-credits-list">' . wp_sprintf( '%l.', $group_data['data'] ) . "</p>\n\n";
143 $compact = 'compact' == $group_data['type'];
144 $classes = 'wp-people-group ' . ( $compact ? 'compact' : '' );
145 echo '<ul class="' . $classes . '" id="wp-people-group-' . $group_slug . '">' . "\n";
146 foreach ( $group_data['data'] as $person_data ) {
147 echo '<li class="wp-person" id="wp-person-' . $person_data[2] . '">' . "\n\t";
148 echo '<a href="' . sprintf( $credits['data']['profiles'], $person_data[2] ) . '">';
149 $size = 'compact' == $group_data['type'] ? '30' : '60';
150 echo '<img src="' . $gravatar . $person_data[1] . '?s=' . $size . '" class="gravatar" alt="' . esc_attr( $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";
153 echo '<span class="title">' . translate( $person_data[3] ) . "</span>\n";
162 <p class="clear"><?php printf( __( 'Want to see your name in lights on this page? <a href="%s">Get involved in WordPress</a>.' ),
163 /* translators: URL to the Make WordPress 'Get Involved' landing page used on the credits page */
164 __( 'https://make.wordpress.org/' ) ); ?></p>
169 include( ABSPATH . 'wp-admin/admin-footer.php' );
173 // These are strings returned by the API that we want to be translatable
174 __( 'Project Leaders' );
175 __( 'Extended Core Team' );
176 __( 'Core Developers' );
177 __( 'Recent Rockstars' );
178 __( 'Core Contributors to WordPress %s' );
179 __( 'Contributing Developers' );
180 __( 'Cofounder, Project Lead' );
181 __( 'Lead Developer' );
182 __( 'Release Lead' );
183 __( 'User Experience Lead' );
184 __( 'Core Developer' );
185 __( 'Core Committer' );
186 __( 'Guest Committer' );
190 __( 'Internationalization' );
191 __( 'External Libraries' );