home *** CD-ROM | disk | FTP | other *** search
/ HTML Examples / WP.iso / wordpress2 / wp-admin / credits.php < prev    next >
Encoding:
PHP Script  |  2017-11-12  |  4.8 KB  |  130 lines

  1. <?php
  2. /**
  3.  * Credits administration panel.
  4.  *
  5.  * @package WordPress
  6.  * @subpackage Administration
  7.  */
  8.  
  9. /** WordPress Administration Bootstrap */
  10. require_once( dirname( __FILE__ ) . '/admin.php' );
  11. require_once( dirname( __FILE__ ) . '/includes/credits.php' );
  12.  
  13. $title = __( 'Credits' );
  14.  
  15. list( $display_version ) = explode( '-', get_bloginfo( 'version' ) );
  16.  
  17. include( ABSPATH . 'wp-admin/admin-header.php' );
  18. ?>
  19. <div class="wrap about-wrap full-width-layout">
  20.  
  21. <h1><?php printf( __( 'Welcome to WordPress %s' ), $display_version ); ?></h1>
  22.  
  23. <p class="about-text"><?php printf( __( 'Thank you for updating to the latest version! WordPress %s will smooth your design workflow and keep you safe from coding errors.' ), $display_version ); ?></p>
  24.  
  25. <div class="wp-badge"><?php printf( __( 'Version %s' ), $display_version ); ?></div>
  26.  
  27. <h2 class="nav-tab-wrapper wp-clearfix">
  28.     <a href="about.php" class="nav-tab"><?php _e( 'What’s New' ); ?></a>
  29.     <a href="credits.php" class="nav-tab nav-tab-active"><?php _e( 'Credits' ); ?></a>
  30.     <a href="freedoms.php" class="nav-tab"><?php _e( 'Freedoms' ); ?></a>
  31.     <a href="privacy.php" class="nav-tab"><?php _e( 'Privacy' ); ?></a>
  32. </h2>
  33.  
  34. <div class="about-wrap-content">
  35. <?php
  36.  
  37. $credits = wp_credits();
  38.  
  39. if ( ! $credits ) {
  40.     echo '<p class="about-description">';
  41.     /* translators: 1: https://wordpress.org/about/, 2: https://make.wordpress.org/ */
  42.     printf( __( 'WordPress is created by a <a href="%1$s">worldwide team</a> of passionate individuals. <a href="%2$s">Get involved in WordPress</a>.' ),
  43.         'https://wordpress.org/about/',
  44.         __( 'https://make.wordpress.org/' )
  45.     );
  46.     echo '</p>';
  47.     echo '</div>';
  48.     echo '</div>';
  49.     include( ABSPATH . 'wp-admin/admin-footer.php' );
  50.     exit;
  51. }
  52.  
  53. echo '<p class="about-description">' . __( 'WordPress is created by a worldwide team of passionate individuals.' ) . "</p>\n";
  54.  
  55. foreach ( $credits['groups'] as $group_slug => $group_data ) {
  56.     if ( $group_data['name'] ) {
  57.         if ( 'Translators' == $group_data['name'] ) {
  58.             // Considered a special slug in the API response. (Also, will never be returned for en_US.)
  59.             $title = _x( 'Translators', 'Translate this to be the equivalent of English Translators in your language for the credits page Translators section' );
  60.         } elseif ( isset( $group_data['placeholders'] ) ) {
  61.             $title = vsprintf( translate( $group_data['name'] ), $group_data['placeholders'] );
  62.         } else {
  63.             $title = translate( $group_data['name'] );
  64.         }
  65.  
  66.         echo '<h3 class="wp-people-group">' . esc_html( $title ) . "</h3>\n";
  67.     }
  68.  
  69.     if ( ! empty( $group_data['shuffle'] ) )
  70.         shuffle( $group_data['data'] ); // We were going to sort by ability to pronounce "hierarchical," but that wouldn't be fair to Matt.
  71.  
  72.     switch ( $group_data['type'] ) {
  73.         case 'list' :
  74.             array_walk( $group_data['data'], '_wp_credits_add_profile_link', $credits['data']['profiles'] );
  75.             echo '<p class="wp-credits-list">' . wp_sprintf( '%l.', $group_data['data'] ) . "</p>\n\n";
  76.             break;
  77.         case 'libraries' :
  78.             array_walk( $group_data['data'], '_wp_credits_build_object_link' );
  79.             echo '<p class="wp-credits-list">' . wp_sprintf( '%l.', $group_data['data'] ) . "</p>\n\n";
  80.             break;
  81.         default:
  82.             $compact = 'compact' == $group_data['type'];
  83.             $classes = 'wp-people-group ' . ( $compact ? 'compact' : '' );
  84.             echo '<ul class="' . $classes . '" id="wp-people-group-' . $group_slug . '">' . "\n";
  85.             foreach ( $group_data['data'] as $person_data ) {
  86.                 echo '<li class="wp-person" id="wp-person-' . esc_attr( $person_data[2] ) . '">' . "\n\t";
  87.                 echo '<a href="' . esc_url( sprintf( $credits['data']['profiles'], $person_data[2] ) ) . '" class="web">';
  88.                 $size = 'compact' == $group_data['type'] ? 30 : 60;
  89.                 $data = get_avatar_data( $person_data[1] . '@md5.gravatar.com', array( 'size' => $size ) );
  90.                 $size *= 2;
  91.                 $data2x = get_avatar_data( $person_data[1] . '@md5.gravatar.com', array( 'size' => $size ) );
  92.                 echo '<img src="' . esc_url( $data['url'] ) . '" srcset="' . esc_url( $data2x['url'] ) . ' 2x" class="gravatar" alt="" />' . "\n";
  93.                 echo esc_html( $person_data[0] ) . "</a>\n\t";
  94.                 if ( ! $compact )
  95.                     echo '<span class="title">' . translate( $person_data[3] ) . "</span>\n";
  96.                 echo "</li>\n";
  97.             }
  98.             echo "</ul>\n";
  99.         break;
  100.     }
  101. }
  102.  
  103. ?>
  104. <p class="clear"><?php
  105.     /* translators: %s: https://make.wordpress.org/ */
  106.     printf( __( 'Want to see your name in lights on this page? <a href="%s">Get involved in WordPress</a>.' ),
  107.         __( 'https://make.wordpress.org/' )
  108.     );
  109. ?></p>
  110.  
  111. </div>
  112. </div>
  113. <?php
  114.  
  115. include( ABSPATH . 'wp-admin/admin-footer.php' );
  116.  
  117. return;
  118.  
  119. // These are strings returned by the API that we want to be translatable
  120. __( 'Project Leaders' );
  121. __( 'Core Contributors to WordPress %s' );
  122. __( 'Noteworthy Contributors' );
  123. __( 'Cofounder, Project Lead' );
  124. __( 'Lead Developer' );
  125. __( 'Release Lead' );
  126. __( 'Release Design Lead' );
  127. __( 'Release Deputy' );
  128. __( 'Core Developer' );
  129. __( 'External Libraries' );
  130.