Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 162 lines (129 sloc) 5.965 kb
527212f Credits page. see #17384.
nacin authored
1 <?php
2 /**
3 * Credits administration panel.
4 *
5 * @package WordPress
6 * @subpackage Administration
7 */
8
9 /** WordPress Administration Bootstrap */
10 require_once( './admin.php' );
11
12 $title = __( 'Credits' );
13
14 function wp_credits() {
15 global $wp_version;
16 $locale = get_locale();
17
aea586c Update the Credits page for changes in the API. see #17532.
nacin authored
18 $results = get_site_transient( 'wordpress_credits_' . $locale );
527212f Credits page. see #17384.
nacin authored
19
82e5383 Skip cached credits if version number doesn't match. props duck_. fix…
nacin authored
20 if ( ! is_array( $results )
21 || ( isset( $results['data']['version'] ) && strpos( $wp_version, $results['data']['version'] ) !== 0 )
22 ) {
19cb1a7 Oops. Credits API version remain unchanged. see #17518.
nacin authored
23 $response = wp_remote_get( "http://api.wordpress.org/core/credits/1.0/?version=$wp_version&locale=$locale" );
527212f Credits page. see #17384.
nacin authored
24
25 if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) )
13a1834 Add core contributors to credits page, first pass. see #17384.
nacin authored
26 return false;
bcd685e Allow Codex URLs to be translated. Don't offer wp.org/about/ URLs for…
nacin authored
27
59bc5be Credits screen redux. Add external libraries, gravatars for language …
nacin authored
28 $results = maybe_unserialize( wp_remote_retrieve_body( $response ) );
13a1834 Add core contributors to credits page, first pass. see #17384.
nacin authored
29
aea586c Update the Credits page for changes in the API. see #17532.
nacin authored
30 if ( ! is_array( $results ) )
13a1834 Add core contributors to credits page, first pass. see #17384.
nacin authored
31 return false;
527212f Credits page. see #17384.
nacin authored
32
4e67a7f Affirm current credits timeout. see #17759.
nacin authored
33 set_site_transient( 'wordpress_credits_' . $locale, $results, 86400 ); // One day
527212f Credits page. see #17384.
nacin authored
34 }
35
13a1834 Add core contributors to credits page, first pass. see #17384.
nacin authored
36 return $results;
37 }
38
59bc5be Credits screen redux. Add external libraries, gravatars for language …
nacin authored
39 function _wp_credits_add_profile_link( &$display_name, $username, $profiles ) {
40 $display_name = '<a href="' . esc_url( sprintf( $profiles, $username ) ) . '">' . esc_html( $display_name ) . '</a>';
41 }
42
43 function _wp_credits_build_object_link( &$data ) {
44 $data = '<a href="' . esc_url( $data[1] ) . '">' . $data[0] . '</a>';
527212f Credits page. see #17384.
nacin authored
45 }
46
fbc85c0 Yank version numbers out of translated strings. TODO decide whether t…
nacin authored
47 list( $display_version ) = explode( '-', $wp_version );
48
5b4f2f0 Create a network/about.php page and leverage it, to prevent the dashb…
nacin authored
49 include( ABSPATH . 'wp-admin/admin-header.php' );
527212f Credits page. see #17384.
nacin authored
50 ?>
bbd1632 Add about.php text/tabs to credits.php and freedoms.php. (Caution: St…
nacin authored
51 <div class="wrap about-wrap">
52
8ae3228 Copy about text to credits.php and freedoms.php.
nacin authored
53 <h1><?php printf( __( 'Welcome to WordPress %s' ), $display_version ); ?></h1>
bbd1632 Add about.php text/tabs to credits.php and freedoms.php. (Caution: St…
nacin authored
54
0ff7d69 Copy 3.4 about.php header text to credits and freedoms. props pavelev…
nacin authored
55 <div class="about-text"><?php printf( __( 'Thank you for updating to the latest version! WordPress %s is already making your website better, faster, and more attractive, just like you!' ), $display_version ); ?></div>
bbd1632 Add about.php text/tabs to credits.php and freedoms.php. (Caution: St…
nacin authored
56
fbc85c0 Yank version numbers out of translated strings. TODO decide whether t…
nacin authored
57 <div class="wp-badge"><?php printf( __( 'Version %s' ), $display_version ); ?></div>
bbd1632 Add about.php text/tabs to credits.php and freedoms.php. (Caution: St…
nacin authored
58
59 <h2 class="nav-tab-wrapper">
04f70c1 Remove copy-pasted classes. see #18742.
nacin authored
60 <a href="about.php" class="nav-tab">
ce2e655 Add about.php maintenance/security release strings for translation. s…
nacin authored
61 <?php _e( 'What&#8217;s New' ); ?>
bbd1632 Add about.php text/tabs to credits.php and freedoms.php. (Caution: St…
nacin authored
62 </a><a href="credits.php" class="nav-tab nav-tab-active">
63 <?php _e( 'Credits' ); ?>
64 </a><a href="freedoms.php" class="nav-tab">
65 <?php _e( 'Freedoms' ); ?>
66 </a>
67 </h2>
527212f Credits page. see #17384.
nacin authored
68
69 <?php
70
59bc5be Credits screen redux. Add external libraries, gravatars for language …
nacin authored
71 $credits = wp_credits();
13a1834 Add core contributors to credits page, first pass. see #17384.
nacin authored
72
59bc5be Credits screen redux. Add external libraries, gravatars for language …
nacin authored
73 if ( ! $credits ) {
2381c93 Formatting and CSS for credits and freedoms pages. see #18742.
koopersmith authored
74 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>.' ),
24cb921 Move the codex link into a seperate translation so you don't have to …
westi authored
75 'http://wordpress.org/about/',
8fe1a42 Prepare the Credits page to handle translators. see #17532.
nacin authored
76 /* translators: Url to the codex documentation on contributing to WordPress used on the credits page */
77 __( 'http://codex.wordpress.org/Contributing_to_WordPress' ) ) . '</p>';
5b4f2f0 Create a network/about.php page and leverage it, to prevent the dashb…
nacin authored
78 include( ABSPATH . 'wp-admin/admin-footer.php' );
13a1834 Add core contributors to credits page, first pass. see #17384.
nacin authored
79 exit;
80 }
81
6a29b5a Remove the the typo that no one noticed on the the credits screen.
markjaquith authored
82 echo '<p class="about-description">' . __( 'WordPress is created by a worldwide team of passionate individuals.' ) . "</p>\n";
13a1834 Add core contributors to credits page, first pass. see #17384.
nacin authored
83
84 $gravatar = is_ssl() ? 'https://secure.gravatar.com/avatar/' : 'http://0.gravatar.com/avatar/';
85
59bc5be Credits screen redux. Add external libraries, gravatars for language …
nacin authored
86 foreach ( $credits['groups'] as $group_slug => $group_data ) {
87 if ( $group_data['name'] ) {
88 if ( 'Translators' == $group_data['name'] ) {
89 // Considered a special slug in the API response. (Also, will never be returned for en_US.)
90 $title = _x( 'Translators', 'Translate this to be the equivalent of English Translators in your language for the credits page Translators section' );
91 } elseif ( isset( $group_data['placeholders'] ) ) {
92 $title = vsprintf( translate( $group_data['name'] ), $group_data['placeholders'] );
93 } else {
45bf3f0 Add missing translate() call.
nacin authored
94 $title = translate( $group_data['name'] );
59bc5be Credits screen redux. Add external libraries, gravatars for language …
nacin authored
95 }
96
2381c93 Formatting and CSS for credits and freedoms pages. see #18742.
koopersmith authored
97 echo '<h4 class="wp-people-group">' . $title . "</h4>\n";
527212f Credits page. see #17384.
nacin authored
98 }
13a1834 Add core contributors to credits page, first pass. see #17384.
nacin authored
99
59bc5be Credits screen redux. Add external libraries, gravatars for language …
nacin authored
100 if ( ! empty( $group_data['shuffle'] ) )
101 shuffle( $group_data['data'] ); // We were going to sort by ability to pronounce "hierarchical," but that wouldn't be fair to Matt.
102
103 switch ( $group_data['type'] ) {
104 case 'list' :
105 array_walk( $group_data['data'], '_wp_credits_add_profile_link', $credits['data']['profiles'] );
106 echo '<p class="wp-credits-list">' . wp_sprintf( '%l.', $group_data['data'] ) . "</p>\n\n";
107 break;
108 case 'libraries' :
109 array_walk( $group_data['data'], '_wp_credits_build_object_link' );
110 echo '<p class="wp-credits-list">' . wp_sprintf( '%l.', $group_data['data'] ) . "</p>\n\n";
111 break;
112 default:
113 $compact = 'compact' == $group_data['type'];
114 $classes = 'wp-people-group ' . ( $compact ? 'compact' : '' );
115 echo '<ul class="' . $classes . '" id="wp-people-group-' . $group_slug . '">' . "\n";
116 foreach ( $group_data['data'] as $person_data ) {
117 echo '<li class="wp-person" id="wp-person-' . $person_data[2] . '">' . "\n\t";
118 echo '<a href="' . sprintf( $credits['data']['profiles'], $person_data[2] ) . '">';
119 $size = 'compact' == $group_data['type'] ? '30' : '60';
120 echo '<img src="' . $gravatar . $person_data[1] . '?s=' . $size . '" class="gravatar" alt="' . esc_attr( $person_data[0] ) . '" /></a>' . "\n\t";
121 echo '<a class="web" href="' . sprintf( $credits['data']['profiles'], $person_data[2] ) . '">' . $person_data[0] . "</a>\n\t";
122 if ( ! $compact )
2381c93 Formatting and CSS for credits and freedoms pages. see #18742.
koopersmith authored
123 echo '<span class="title">' . translate( $person_data[3] ) . "</span>\n";
59bc5be Credits screen redux. Add external libraries, gravatars for language …
nacin authored
124 echo "</li>\n";
125 }
126 echo "</ul>\n";
127 break;
8fe1a42 Prepare the Credits page to handle translators. see #17532.
nacin authored
128 }
527212f Credits page. see #17384.
nacin authored
129 }
130
131 ?>
24cb921 Move the codex link into a seperate translation so you don't have to …
westi authored
132 <p class="clear"><?php printf( __( 'Want to see your name in lights on this page? <a href="%s">Get involved in WordPress</a>.' ),
8fe1a42 Prepare the Credits page to handle translators. see #17532.
nacin authored
133 /* translators: Url to the codex documentation on contributing to WordPress used on the credits page */
134 __( 'http://codex.wordpress.org/Contributing_to_WordPress' ) ); ?></p>
527212f Credits page. see #17384.
nacin authored
135
136 </div>
13a1834 Add core contributors to credits page, first pass. see #17384.
nacin authored
137 <?php
138
5b4f2f0 Create a network/about.php page and leverage it, to prevent the dashb…
nacin authored
139 include( ABSPATH . 'wp-admin/admin-footer.php' );
13a1834 Add core contributors to credits page, first pass. see #17384.
nacin authored
140
141 return;
142
38fe430 Use context to tell the translators what to do and thereby remove a u…
westi authored
143 // These are strings returned by the API that we want to be translatable
13a1834 Add core contributors to credits page, first pass. see #17384.
nacin authored
144 __( 'Project Leaders' );
145 __( 'Extended Core Team' );
76aef41 New string on credits.php.
nacin authored
146 __( 'Core Developers' );
13a1834 Add core contributors to credits page, first pass. see #17384.
nacin authored
147 __( 'Recent Rockstars' );
148 __( 'Core Contributors to WordPress %s' );
b701e9e Add 'Contributing Developers' string to credits.php so it makes it in…
nacin authored
149 __( 'Contributing Developers' );
13a1834 Add core contributors to credits page, first pass. see #17384.
nacin authored
150 __( 'Cofounder, Project Lead' );
151 __( 'Lead Developer' );
43cdde7 String swap. see #17532.
nacin authored
152 __( 'User Experience Lead' );
1b1863b Style updates to translators list on Credits page. see #18742.
nacin authored
153 __( 'Core Developer' );
59bc5be Credits screen redux. Add external libraries, gravatars for language …
nacin authored
154 __( 'Core Committer' );
155 __( 'Guest Committer' );
13a1834 Add core contributors to credits page, first pass. see #17384.
nacin authored
156 __( 'Developer' );
157 __( 'Designer' );
ba6a9a2 Some more credits strings.
nacin authored
158 __( 'XML-RPC' );
13a1834 Add core contributors to credits page, first pass. see #17384.
nacin authored
159 __( 'Internationalization' );
59bc5be Credits screen redux. Add external libraries, gravatars for language …
nacin authored
160 __( 'External Libraries' );
ba6a9a2 Some more credits strings.
nacin authored
161 __( 'Icon Design' );
Something went wrong with that request. Please try again.