wp/wp-admin/credits.php
changeset 16 a86126ab1dd4
parent 9 177826044cd9
child 18 be944660c56a
equal deleted inserted replaced
15:3d4e9c994f10 16:a86126ab1dd4
     5  * @package WordPress
     5  * @package WordPress
     6  * @subpackage Administration
     6  * @subpackage Administration
     7  */
     7  */
     8 
     8 
     9 /** WordPress Administration Bootstrap */
     9 /** WordPress Administration Bootstrap */
    10 require_once( dirname( __FILE__ ) . '/admin.php' );
    10 require_once __DIR__ . '/admin.php';
    11 require_once( dirname( __FILE__ ) . '/includes/credits.php' );
    11 require_once __DIR__ . '/includes/credits.php';
    12 
    12 
    13 $title = __( 'Credits' );
    13 $title = __( 'Credits' );
    14 
    14 
    15 list( $display_version ) = explode( '-', get_bloginfo( 'version' ) );
    15 list( $display_version ) = explode( '-', get_bloginfo( 'version' ) );
    16 
    16 
    17 include( ABSPATH . 'wp-admin/admin-header.php' );
    17 require_once ABSPATH . 'wp-admin/admin-header.php';
    18 ?>
       
    19 <div class="wrap about-wrap full-width-layout">
       
    20 
       
    21 <h1>
       
    22 	<?php
       
    23 	/* translators: %s: The current WordPress version number */
       
    24 	printf( __( 'Welcome to WordPress&nbsp;%s' ), $display_version );
       
    25 	?>
       
    26 </h1>
       
    27 
       
    28 <p class="about-text">
       
    29 	<?php
       
    30 	printf(
       
    31 		/* translators: %s: The current WordPress version number */
       
    32 		__( 'Congratulations on updating to WordPress %s! This update makes it easier than ever to fix your site if something goes wrong.' ),
       
    33 		$display_version
       
    34 	);
       
    35 	?>
       
    36 </p>
       
    37 
       
    38 <div class="wp-badge">
       
    39 	<?php
       
    40 	/* translators: %s: The current WordPress version number */
       
    41 	printf( __( 'Version %s' ), $display_version );
       
    42 	?>
       
    43 </div>
       
    44 
       
    45 <nav class="nav-tab-wrapper wp-clearfix" aria-label="<?php esc_attr_e( 'Secondary menu' ); ?>">
       
    46 	<a href="about.php" class="nav-tab"><?php _e( 'What&#8217;s New' ); ?></a>
       
    47 	<a href="credits.php" class="nav-tab nav-tab-active" aria-current="page"><?php _e( 'Credits' ); ?></a>
       
    48 	<a href="freedoms.php" class="nav-tab"><?php _e( 'Freedoms' ); ?></a>
       
    49 	<a href="freedoms.php?privacy-notice" class="nav-tab"><?php _e( 'Privacy' ); ?></a>
       
    50 </nav>
       
    51 
       
    52 <div class="about-wrap-content">
       
    53 <?php
       
    54 
    18 
    55 $credits = wp_credits();
    19 $credits = wp_credits();
       
    20 ?>
       
    21 <div class="wrap about__container">
    56 
    22 
       
    23 	<div class="about__header">
       
    24 		<div class="about__header-text">
       
    25 			<?php _e( 'Speed. Search. Security.' ); ?>
       
    26 		</div>
       
    27 
       
    28 		<div class="about__header-title">
       
    29 			<p>
       
    30 				<?php _e( 'WordPress' ); ?>
       
    31 				<span><?php echo $display_version; ?></span>
       
    32 			</p>
       
    33 		</div>
       
    34 
       
    35 		<nav class="about__header-navigation nav-tab-wrapper wp-clearfix" aria-label="<?php esc_attr_e( 'Secondary menu' ); ?>">
       
    36 			<a href="about.php" class="nav-tab"><?php _e( 'What&#8217;s New' ); ?></a>
       
    37 			<a href="credits.php" class="nav-tab nav-tab-active" aria-current="page"><?php _e( 'Credits' ); ?></a>
       
    38 			<a href="freedoms.php" class="nav-tab"><?php _e( 'Freedoms' ); ?></a>
       
    39 			<a href="privacy.php" class="nav-tab"><?php _e( 'Privacy' ); ?></a>
       
    40 		</nav>
       
    41 	</div>
       
    42 
       
    43 	<div class="about__section is-feature">
       
    44 		<div class="column">
       
    45 			<h1><?php _e( 'Credits' ); ?></h1>
       
    46 
       
    47 			<?php if ( ! $credits ) : ?>
       
    48 
       
    49 			<p>
       
    50 				<?php
       
    51 				printf(
       
    52 					/* translators: 1: https://wordpress.org/about/, 2: https://make.wordpress.org/ */
       
    53 					__( 'WordPress is created by a <a href="%1$s">worldwide team</a> of passionate individuals. <a href="%2$s">Get involved in WordPress</a>.' ),
       
    54 					__( 'https://wordpress.org/about/' ),
       
    55 					__( 'https://make.wordpress.org/' )
       
    56 				);
       
    57 				?>
       
    58 			</p>
       
    59 
       
    60 			<?php else : ?>
       
    61 
       
    62 			<p>
       
    63 				<?php _e( 'WordPress is created by a worldwide team of passionate individuals.' ); ?>
       
    64 			</p>
       
    65 			<p>
       
    66 				<?php
       
    67 				printf(
       
    68 					/* translators: %s: https://make.wordpress.org/ */
       
    69 					__( 'Want to see your name in lights on this page? <a href="%s">Get involved in WordPress</a>.' ),
       
    70 					__( 'https://make.wordpress.org/' )
       
    71 				);
       
    72 				?>
       
    73 			</p>
       
    74 
       
    75 			<?php endif; ?>
       
    76 		</div>
       
    77 	</div>
       
    78 
       
    79 <?php
    57 if ( ! $credits ) {
    80 if ( ! $credits ) {
    58 	echo '<p class="about-description">';
       
    59 	printf(
       
    60 		/* translators: 1: https://wordpress.org/about/, 2: https://make.wordpress.org/ */
       
    61 		__( 'WordPress is created by a <a href="%1$s">worldwide team</a> of passionate individuals. <a href="%2$s">Get involved in WordPress</a>.' ),
       
    62 		'https://wordpress.org/about/',
       
    63 		__( 'https://make.wordpress.org/' )
       
    64 	);
       
    65 	echo '</p>';
       
    66 	echo '</div>';
    81 	echo '</div>';
    67 	echo '</div>';
    82 	require_once ABSPATH . 'wp-admin/admin-footer.php';
    68 	include( ABSPATH . 'wp-admin/admin-footer.php' );
       
    69 	exit;
    83 	exit;
    70 }
    84 }
       
    85 ?>
    71 
    86 
    72 echo '<p class="about-description">' . __( 'WordPress is created by a worldwide team of passionate individuals.' ) . "</p>\n";
    87 	<hr />
    73 
    88 
    74 echo '<p>' . sprintf(
    89 	<div class="about__section">
    75 	/* translators: %s: https://make.wordpress.org/ */
    90 		<div class="column has-subtle-background-color">
    76 	__( 'Want to see your name in lights on this page? <a href="%s">Get involved in WordPress</a>.' ),
    91 			<?php wp_credits_section_title( $credits['groups']['core-developers'] ); ?>
    77 	__( 'https://make.wordpress.org/' )
    92 			<?php wp_credits_section_list( $credits, 'core-developers' ); ?>
    78 ) . '</p>';
    93 			<?php wp_credits_section_list( $credits, 'contributing-developers' ); ?>
       
    94 		</div>
       
    95 	</div>
    79 
    96 
    80 foreach ( $credits['groups'] as $group_slug => $group_data ) {
    97 	<hr />
    81 	if ( $group_data['name'] ) {
       
    82 		if ( 'Translators' == $group_data['name'] ) {
       
    83 			// Considered a special slug in the API response. (Also, will never be returned for en_US.)
       
    84 			$title = _x( 'Translators', 'Translate this to be the equivalent of English Translators in your language for the credits page Translators section' );
       
    85 		} elseif ( isset( $group_data['placeholders'] ) ) {
       
    86 			// phpcs:ignore WordPress.WP.I18n.LowLevelTranslationFunction,WordPress.WP.I18n.NonSingularStringLiteralText
       
    87 			$title = vsprintf( translate( $group_data['name'] ), $group_data['placeholders'] );
       
    88 		} else {
       
    89 			// phpcs:ignore WordPress.WP.I18n.LowLevelTranslationFunction,WordPress.WP.I18n.NonSingularStringLiteralText
       
    90 			$title = translate( $group_data['name'] );
       
    91 		}
       
    92 
    98 
    93 		echo '<h2 class="wp-people-group">' . esc_html( $title ) . "</h2>\n";
    99 	<div class="about__section">
    94 	}
   100 		<div class="column">
       
   101 			<?php wp_credits_section_title( $credits['groups']['props'] ); ?>
       
   102 			<?php wp_credits_section_list( $credits, 'props' ); ?>
       
   103 		</div>
       
   104 	</div>
    95 
   105 
    96 	if ( ! empty( $group_data['shuffle'] ) ) {
   106 	<hr />
    97 		shuffle( $group_data['data'] ); // We were going to sort by ability to pronounce "hierarchical," but that wouldn't be fair to Matt.
       
    98 	}
       
    99 
   107 
   100 	switch ( $group_data['type'] ) {
   108 	<?php if ( isset( $credits['groups']['translators'] ) || isset( $credits['groups']['validators'] ) ) : ?>
   101 		case 'list':
   109 	<div class="about__section">
   102 			array_walk( $group_data['data'], '_wp_credits_add_profile_link', $credits['data']['profiles'] );
   110 		<div class="column">
   103 			echo '<p class="wp-credits-list">' . wp_sprintf( '%l.', $group_data['data'] ) . "</p>\n\n";
   111 			<?php wp_credits_section_title( $credits['groups']['validators'] ); ?>
   104 			break;
   112 			<?php wp_credits_section_list( $credits, 'validators' ); ?>
   105 		case 'libraries':
   113 			<?php wp_credits_section_list( $credits, 'translators' ); ?>
   106 			array_walk( $group_data['data'], '_wp_credits_build_object_link' );
   114 		</div>
   107 			echo '<p class="wp-credits-list">' . wp_sprintf( '%l.', $group_data['data'] ) . "</p>\n\n";
   115 	</div>
   108 			break;
       
   109 		default:
       
   110 			$compact = 'compact' == $group_data['type'];
       
   111 			$classes = 'wp-people-group ' . ( $compact ? 'compact' : '' );
       
   112 			echo '<ul class="' . $classes . '" id="wp-people-group-' . $group_slug . '">' . "\n";
       
   113 			foreach ( $group_data['data'] as $person_data ) {
       
   114 				echo '<li class="wp-person" id="wp-person-' . esc_attr( $person_data[2] ) . '">' . "\n\t";
       
   115 				echo '<a href="' . esc_url( sprintf( $credits['data']['profiles'], $person_data[2] ) ) . '" class="web">';
       
   116 				$size   = 'compact' == $group_data['type'] ? 30 : 60;
       
   117 				$data   = get_avatar_data( $person_data[1] . '@md5.gravatar.com', array( 'size' => $size ) );
       
   118 				$size  *= 2;
       
   119 				$data2x = get_avatar_data( $person_data[1] . '@md5.gravatar.com', array( 'size' => $size ) );
       
   120 				echo '<img src="' . esc_url( $data['url'] ) . '" srcset="' . esc_url( $data2x['url'] ) . ' 2x" class="gravatar" alt="" />' . "\n";
       
   121 				echo esc_html( $person_data[0] ) . "</a>\n\t";
       
   122 				if ( ! $compact ) {
       
   123 					// phpcs:ignore WordPress.WP.I18n.LowLevelTranslationFunction,WordPress.WP.I18n.NonSingularStringLiteralText
       
   124 					echo '<span class="title">' . translate( $person_data[3] ) . "</span>\n";
       
   125 				}
       
   126 				echo "</li>\n";
       
   127 			}
       
   128 			echo "</ul>\n";
       
   129 			break;
       
   130 	}
       
   131 }
       
   132 
   116 
   133 ?>
   117 	<hr />
   134 </div>
   118 	<?php endif; ?>
       
   119 
       
   120 	<div class="about__section">
       
   121 		<div class="column">
       
   122 			<?php wp_credits_section_title( $credits['groups']['libraries'] ); ?>
       
   123 			<?php wp_credits_section_list( $credits, 'libraries' ); ?>
       
   124 		</div>
       
   125 	</div>
   135 </div>
   126 </div>
   136 <?php
   127 <?php
   137 
   128 
   138 include( ABSPATH . 'wp-admin/admin-footer.php' );
   129 require_once ABSPATH . 'wp-admin/admin-footer.php';
   139 
   130 
   140 return;
   131 return;
   141 
   132 
   142 // These are strings returned by the API that we want to be translatable
   133 // These are strings returned by the API that we want to be translatable.
   143 __( 'Project Leaders' );
   134 __( 'Project Leaders' );
   144 /* translators: %s: The current WordPress version number */
   135 /* translators: %s: The current WordPress version number. */
   145 __( 'Core Contributors to WordPress %s' );
   136 __( 'Core Contributors to WordPress %s' );
   146 __( 'Noteworthy Contributors' );
   137 __( 'Noteworthy Contributors' );
   147 __( 'Cofounder, Project Lead' );
   138 __( 'Cofounder, Project Lead' );
   148 __( 'Lead Developer' );
   139 __( 'Lead Developer' );
   149 __( 'Release Lead' );
   140 __( 'Release Lead' );