credits.php 4.8 KB

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