From 269d00f0038c862c3cc5b402bab9d09ce9ca310f Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 11 Nov 2019 20:46:56 +0000 Subject: [PATCH] Help/About: Update the 5.3 About page. * Remove the SVG from the upper right corner. * Make sure admin notices that should be hidden stay hidden. * Address a11y issues with contrast. * Fix an issue with the active nav tab hover. * Prevent names on the credits from breaking out of the box. * Update two strings with a more accurate information. * Remove extra padding on the Credits tab. Previously [46556], [46572], [46616]. Reviewed by SergeyBiryukov. Props ryelle, afercia, audrasjb, francina, mapk, desrosj, YordanSoares, melchoyce, azaozz, johnbillion, davidbaumwald, luminuu, bwmarkle, la-geek, SergeyBiryukov. Merges [46705] and [46709] to the 5.3 branch. Fixes #47708. git-svn-id: https://develop.svn.wordpress.org/branches/5.3@46710 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/about.php | 8 +-- src/wp-admin/credits.php | 105 +++++++++++------------------ src/wp-admin/css/about.css | 106 ++++++++++++++++++++++-------- src/wp-admin/freedoms.php | 4 +- src/wp-admin/includes/credits.php | 79 ++++++++++++++++++++++ src/wp-admin/privacy.php | 4 +- 6 files changed, 199 insertions(+), 107 deletions(-) diff --git a/src/wp-admin/about.php b/src/wp-admin/about.php index df5df6b713..a5541669ec 100644 --- a/src/wp-admin/about.php +++ b/src/wp-admin/about.php @@ -26,9 +26,7 @@ include( ABSPATH . 'wp-admin/admin-header.php' ); -
- <?php _e( 'Code is Poetry' ); ?> -
+

@@ -52,7 +50,7 @@ include( ABSPATH . 'wp-admin/admin-header.php' );

- +

@@ -92,7 +90,7 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
  • -
  • +
  • diff --git a/src/wp-admin/credits.php b/src/wp-admin/credits.php index 5d8b1a7eba..af4792d2b4 100644 --- a/src/wp-admin/credits.php +++ b/src/wp-admin/credits.php @@ -28,9 +28,7 @@ $credits = wp_credits(); -
    - <?php _e( 'Code is Poetry' ); ?> -
    +

    @@ -87,76 +85,47 @@ if ( ! $credits ) { include( ABSPATH . 'wp-admin/admin-footer.php' ); exit; } +?> -$previous_type = ''; +


    -foreach ( $credits['groups'] as $group_slug => $group_data ) : - ?> - '; - } - ?>
    -
    - - ' . esc_html( $title ) . "\n"; - } - - if ( ! empty( $group_data['shuffle'] ) ) { - shuffle( $group_data['data'] ); // We were going to sort by ability to pronounce "hierarchical," but that wouldn't be fair to Matt. - } - - switch ( $group_data['type'] ) { - case 'list': - array_walk( $group_data['data'], '_wp_credits_add_profile_link', $credits['data']['profiles'] ); - echo '

    ' . wp_sprintf( '%l.', $group_data['data'] ) . "

    \n\n"; - break; - case 'libraries': - array_walk( $group_data['data'], '_wp_credits_build_object_link' ); - echo '

    ' . wp_sprintf( '%l.', $group_data['data'] ) . "

    \n\n"; - break; - default: - $compact = 'compact' == $group_data['type']; - $classes = 'wp-people-group ' . ( $compact ? 'compact' : '' ); - echo '\n"; - break; - } - $previous_type = $group_data['type']; - ?> - +
    + + + +
    +
    + +
    + +
    +
    + + +
    +
    + +
    + + +
    +
    + + + +
    +
    + +
    + + +
    +
    + +
    -
    -
    - <?php _e( 'Code is Poetry' ); ?> -
    +

    diff --git a/src/wp-admin/includes/credits.php b/src/wp-admin/includes/credits.php index d558e9c812..74d0c6878d 100644 --- a/src/wp-admin/includes/credits.php +++ b/src/wp-admin/includes/credits.php @@ -76,3 +76,82 @@ function _wp_credits_add_profile_link( &$display_name, $username, $profiles ) { function _wp_credits_build_object_link( &$data ) { $data = '' . esc_html( $data[0] ) . ''; } + +/** + * Display a the title for a given group of contributors. + * + * @since 5.3.0 + * + * @param array $group_data The current contributor group. + */ +function wp_credits_section_title( $group_data = array() ) { + if ( ! count( $group_data ) ) { + return; + } + + if ( $group_data['name'] ) { + if ( 'Translators' === $group_data['name'] ) { + // Considered a special slug in the API response. (Also, will never be returned for en_US.) + $title = _x( 'Translators', 'Translate this to be the equivalent of English Translators in your language for the credits page Translators section' ); + } elseif ( isset( $group_data['placeholders'] ) ) { + // phpcs:ignore WordPress.WP.I18n.LowLevelTranslationFunction,WordPress.WP.I18n.NonSingularStringLiteralText + $title = vsprintf( translate( $group_data['name'] ), $group_data['placeholders'] ); + } else { + // phpcs:ignore WordPress.WP.I18n.LowLevelTranslationFunction,WordPress.WP.I18n.NonSingularStringLiteralText + $title = translate( $group_data['name'] ); + } + + echo '

    ' . esc_html( $title ) . "

    \n"; + } +} + +/** + * Display a list of contributors for a given group. + * + * @since 5.3.0 + * + * @param array $credits The credits groups returned from the API. + * @param string $slug The current group to display. + */ +function wp_credits_section_list( $credits = array(), $slug = '' ) { + $group_data = isset( $credits['groups'][ $slug ] ) ? $credits['groups'][ $slug ] : array(); + $credits_data = $credits['data']; + if ( ! count( $group_data ) ) { + return; + } + + if ( ! empty( $group_data['shuffle'] ) ) { + shuffle( $group_data['data'] ); // We were going to sort by ability to pronounce "hierarchical," but that wouldn't be fair to Matt. + } + + switch ( $group_data['type'] ) { + case 'list': + array_walk( $group_data['data'], '_wp_credits_add_profile_link', $credits_data['profiles'] ); + echo '

    ' . wp_sprintf( '%l.', $group_data['data'] ) . "

    \n\n"; + break; + case 'libraries': + array_walk( $group_data['data'], '_wp_credits_build_object_link' ); + echo '

    ' . wp_sprintf( '%l.', $group_data['data'] ) . "

    \n\n"; + break; + default: + $compact = 'compact' === $group_data['type']; + $classes = 'wp-people-group ' . ( $compact ? 'compact' : '' ); + echo '\n"; + break; + } +} diff --git a/src/wp-admin/privacy.php b/src/wp-admin/privacy.php index 1f2d6c2f57..25dc75e00b 100644 --- a/src/wp-admin/privacy.php +++ b/src/wp-admin/privacy.php @@ -25,9 +25,7 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
    -
    - <?php _e( 'Code is Poetry' ); ?> -
    +