Make WordPress Core


Ignore:
Timestamp:
09/11/2015 04:54:20 AM (10 years ago)
Author:
wonderboymusic
Message:

Move ad hoc functions from wp-admin/credits.php to wp-admin/includes/credits.php, which is only included by the former.

See #33813.

File:
1 copied

Legend:

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

    r34035 r34036  
    11<?php
    22/**
    3  * Credits administration panel.
     3 * WordPress Credits Administration API.
    44 *
    55 * @package WordPress
    66 * @subpackage Administration
     7 * @since 4.4.0
    78 */
    8 
    9 /** WordPress Administration Bootstrap */
    10 require_once( dirname( __FILE__ ) . '/admin.php' );
    11 
    12 $title = __( 'Credits' );
    139
    1410/**
     
    7268    $data = '<a href="' . esc_url( $data[1] ) . '">' . esc_html( $data[0] ) . '</a>';
    7369}
    74 
    75 list( $display_version ) = explode( '-', $wp_version );
    76 
    77 include( ABSPATH . 'wp-admin/admin-header.php' );
    78 ?>
    79 <div class="wrap about-wrap">
    80 
    81 <h1><?php printf( __( 'Welcome to WordPress %s' ), $display_version ); ?></h1>
    82 
    83 <div class="about-text"><?php printf( __( 'Thank you for updating! WordPress %s makes it even easier to format your content and customize your site.' ), $display_version ); ?></div>
    84 
    85 <div class="wp-badge"><?php printf( __( 'Version %s' ), $display_version ); ?></div>
    86 
    87 <h2 class="nav-tab-wrapper">
    88     <a href="about.php" class="nav-tab">
    89         <?php _e( 'What&#8217;s New' ); ?>
    90     </a><a href="credits.php" class="nav-tab nav-tab-active">
    91         <?php _e( 'Credits' ); ?>
    92     </a><a href="freedoms.php" class="nav-tab">
    93         <?php _e( 'Freedoms' ); ?>
    94     </a>
    95 </h2>
    96 
    97 <?php
    98 
    99 $credits = wp_credits();
    100 
    101 if ( ! $credits ) {
    102     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>.' ),
    103         'https://wordpress.org/about/',
    104         /* translators: Url to the codex documentation on contributing to WordPress used on the credits page */
    105         __( 'https://codex.wordpress.org/Contributing_to_WordPress' ) ) . '</p>';
    106     include( ABSPATH . 'wp-admin/admin-footer.php' );
    107     exit;
    108 }
    109 
    110 echo '<p class="about-description">' . __( 'WordPress is created by a worldwide team of passionate individuals.' ) . "</p>\n";
    111 
    112 foreach ( $credits['groups'] as $group_slug => $group_data ) {
    113     if ( $group_data['name'] ) {
    114         if ( 'Translators' == $group_data['name'] ) {
    115             // Considered a special slug in the API response. (Also, will never be returned for en_US.)
    116             $title = _x( 'Translators', 'Translate this to be the equivalent of English Translators in your language for the credits page Translators section' );
    117         } elseif ( isset( $group_data['placeholders'] ) ) {
    118             $title = vsprintf( translate( $group_data['name'] ), $group_data['placeholders'] );
    119         } else {
    120             $title = translate( $group_data['name'] );
    121         }
    122 
    123         echo '<h4 class="wp-people-group">' . esc_html( $title ) . "</h4>\n";
    124     }
    125 
    126     if ( ! empty( $group_data['shuffle'] ) )
    127         shuffle( $group_data['data'] ); // We were going to sort by ability to pronounce "hierarchical," but that wouldn't be fair to Matt.
    128 
    129     switch ( $group_data['type'] ) {
    130         case 'list' :
    131             array_walk( $group_data['data'], '_wp_credits_add_profile_link', $credits['data']['profiles'] );
    132             echo '<p class="wp-credits-list">' . wp_sprintf( '%l.', $group_data['data'] ) . "</p>\n\n";
    133             break;
    134         case 'libraries' :
    135             array_walk( $group_data['data'], '_wp_credits_build_object_link' );
    136             echo '<p class="wp-credits-list">' . wp_sprintf( '%l.', $group_data['data'] ) . "</p>\n\n";
    137             break;
    138         default:
    139             $compact = 'compact' == $group_data['type'];
    140             $classes = 'wp-people-group ' . ( $compact ? 'compact' : '' );
    141             echo '<ul class="' . $classes . '" id="wp-people-group-' . $group_slug . '">' . "\n";
    142             foreach ( $group_data['data'] as $person_data ) {
    143                 echo '<li class="wp-person" id="wp-person-' . esc_attr( $person_data[2] ) . '">' . "\n\t";
    144                 echo '<a href="' . esc_url( sprintf( $credits['data']['profiles'], $person_data[2] ) ) . '">';
    145                 $size = 'compact' == $group_data['type'] ? 30 : 60;
    146                 $data = get_avatar_data( $person_data[1] . '@md5.gravatar.com', array( 'size' => $size ) );
    147                 $size *= 2;
    148                 $data2x = get_avatar_data( $person_data[1] . '@md5.gravatar.com', array( 'size' => $size ) );
    149                 echo '<img src="' . esc_url( $data['url'] ) . '" srcset="' . esc_url( $data2x['url'] ) . ' 2x" class="gravatar" alt="' . esc_attr( $person_data[0] ) . '" /></a>' . "\n\t";
    150                 echo '<a class="web" href="' . esc_url( sprintf( $credits['data']['profiles'], $person_data[2] ) ) . '">' . esc_html( $person_data[0] ) . "</a>\n\t";
    151                 if ( ! $compact )
    152                     echo '<span class="title">' . translate( $person_data[3] ) . "</span>\n";
    153                 echo "</li>\n";
    154             }
    155             echo "</ul>\n";
    156         break;
    157     }
    158 }
    159 
    160 ?>
    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     /* translators: URL to the Make WordPress 'Get Involved' landing page used on the credits page */
    163     __( 'https://make.wordpress.org/' ) ); ?></p>
    164 
    165 </div>
    166 <?php
    167 
    168 include( ABSPATH . 'wp-admin/admin-footer.php' );
    169 
    170 return;
    171 
    172 // These are strings returned by the API that we want to be translatable
    173 __( 'Project Leaders' );
    174 __( 'Extended Core Team' );
    175 __( 'Core Developers' );
    176 __( 'Recent Rockstars' );
    177 __( 'Core Contributors to WordPress %s' );
    178 __( 'Contributing Developers' );
    179 __( 'Cofounder, Project Lead' );
    180 __( 'Lead Developer' );
    181 __( 'Release Lead' );
    182 __( 'User Experience Lead' );
    183 __( 'Core Developer' );
    184 __( 'Core Committer' );
    185 __( 'Guest Committer' );
    186 __( 'Developer' );
    187 __( 'Designer' );
    188 __( 'Docs Committer' );
    189 __( 'XML-RPC' );
    190 __( 'Internationalization' );
    191 __( 'External Libraries' );
    192 __( 'Icon Design' );
Note: See TracChangeset for help on using the changeset viewer.