Make WordPress Core

Changeset 17909


Ignore:
Timestamp:
05/13/2011 12:49:53 AM (14 years ago)
Author:
nacin
Message:

Add core contributors to credits page, first pass. see #17384.

Location:
trunk/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/credits.php

    r17877 r17909  
    1616function add_css() { ?>
    1717<style type="text/css">
    18 h3.wp-people-group { clear: both; }
     18h3.wp-people-group, h3.wp-props-group { clear: both; }
    1919ul.wp-people-group { margin-bottom: 50px; }
    2020li.wp-person { float: left; height: 100px; width: 240px; margin-right: 20px; }
     
    3434
    3535        if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) )
    36             return new WP_Error( 'credits_fail', "Oops. We'll need to put a link to WP.org if the HTTP request fails." );
     36            return false;
    3737   
    38         $people = unserialize( wp_remote_retrieve_body( $response ) );
    39    
    40         if ( ! $people )
    41             return new WP_Error( 'credits_fail', "Oops. We'll need to put a link to WP.org if the HTTP request fails." );
     38        $results = unserialize( wp_remote_retrieve_body( $response ) );
     39
     40        if ( ! $results )
     41            return false;
    4242
    4343        set_site_transient( 'wordpress_credits', $people, 604800 ); // One week.
    4444    }
    4545
    46     return $people;
     46    return $results;
     47}
     48
     49function _wp_credits_add_profile_link( &$user, $key, $prefix ) {
     50    $user = '<a href="' . esc_url( $prefix . $user ) . '">' . esc_html( $user ) . '</a>';
    4751}
    4852
     
    5357<h2><?php _e( 'WordPress Credits' ); ?></h2>
    5458
    55 <p><?php _e( "WordPress is created by a worldwide team of passionate individuals. We couldn't possibly list them all, but here some of the most influential people currently involved with the project:" ); ?></p>
    56 
    5759<?php
    5860
    59 $people = wp_credits();
    60 if ( is_wp_error( $people ) ) {
    61     echo $people->get_error_message();
    62 } else {
     61$results = wp_credits();
    6362
    64     unset( $people['props'] ); // @TODO
     63if ( false === $results ) {
     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        'http://wordpress.org/about/',
     66        'http://codex.wordpress.org/Contributing_to_WordPress' ) . '</p>';
     67    include( './admin-footer.php' );
     68    exit;
     69}
    6570
    66     foreach ( $people as $group => $members ) {
    67         echo '<h3 class="wp-people-group">' . $group . '</h3>';
    68         echo '<ul class="wp-people-group" id="wp-people-group-' . $group . '">';
    69         shuffle( $members ); // We were going to sort by ability to pronounce "hierarchical," but that wouldn't be fair to Matt.
    70         foreach ( $members as $slug => $member ) {
    71             echo '<li class="wp-person" id="wp-person-' . $slug . '"><img src="http://gravatar.com/avatar/' . $member[3] . '?s=60&r=PG" class="gravatar" /><a class="web" href="' . $member[2] . '">' . $member[0] . '</a><br /><span class="title">' . $member[1] . '</span></li>';
    72         }
    73         echo '</ul>';
     71echo '<p>' . __( "WordPress is created by a worldwide team of passionate individuals. We couldn't possibly list them all, but here some of the most influential people currently involved with the project:" ) . "<p>\n";
     72
     73$gravatar = is_ssl() ? 'https://secure.gravatar.com/avatar/' : 'http://0.gravatar.com/avatar/';
     74
     75foreach ( $results['people'] as $group_slug => $members ) {
     76    echo '<h3 class="wp-people-group">' . translate( $results['groups'][ $group_slug ] ) . "</h3>\n";
     77    echo '<ul class="wp-people-group" id="wp-people-group-' . $group_slug . '">' . "\n";
     78    shuffle( $members ); // We were going to sort by ability to pronounce "hierarchical," but that wouldn't be fair to Matt.
     79    foreach ( $members as $member_slug => $member ) {
     80        echo '<li class="wp-person" id="wp-person-' . $member_slug . '"><img src="' . $gravatar . $member[3] . '?s=60" class="gravatar" /><a class="web" href="' . $results['data']['profile_prefix'] . $member[2] . '">' . $member[0] . '</a><br /><span class="title">' . translate( $member[1] ) . "</span></li>\n";
    7481    }
     82    echo "</ul>\n";
     83}
     84
     85if ( isset( $results['props'] ) ) {
     86    echo '<h3 class="wp-props-group">' . sprintf( translate( $results['groups']['props'] ), $results['data']['version'] ) . "</h3>\n\n";
     87    array_walk( $results['props'], '_wp_credits_add_profile_link', $results['data']['profile_prefix'] );
     88    shuffle( $results['props'] );
     89    echo wp_sprintf( '%l.', $results['props'] );
    7590}
    7691
     
    7994
    8095</div>
    81 <?php include( 'admin-footer.php' ); ?>
     96<?php
     97
     98include( './admin-footer.php' );
     99
     100return;
     101
     102__( 'Project Leaders' );
     103__( 'Extended Core Team' );
     104__( 'Recent Rockstars' );
     105__( 'Core Contributors to WordPress %s' );
     106__( 'Cofounder, Project Lead' );
     107__( 'Lead Developer' );
     108__( 'UI/UX and Community Lead' );
     109__( 'Developer, Core Committer' );
     110__( 'Developer' );
     111__( 'Designer' );
     112__( 'XML-RPC Developer' );
     113__( 'Internationalization' );
     114
     115?>
  • trunk/wp-admin/freedoms.php

    r17904 r17909  
    4040
    4141</div>
    42 <?php include( 'admin-footer.php' ); ?>
     42<?php include( './admin-footer.php' ); ?>
Note: See TracChangeset for help on using the changeset viewer.