WordPress.org

Making WordPress.org


Ignore:
Timestamp:
10/10/2016 07:46:37 PM (3 years ago)
Author:
coffee2code
Message:

Forums Theme: Show Slack username and/or WordPress.org username (linked to profiles.wordpress.org) in user profiles.

Also adds missing translator comments for all the placeholders in the same block.

Props SergeyBiryukov.
Fixes #2068.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-forums/bbpress/user-profile.php

    r4145 r4206  
    2121
    2222        <?php if ( current_user_can( 'moderate' ) ) : ?>
    23         <p class="bbp-user-email"><?php        printf( esc_html__( 'Email: %s',           'wporg-forums' ), bbp_get_displayed_user_field( 'user_email' ) ); ?></p>
     23
     24            <p class="bbp-user-email"><?php
     25                /* translators: %s: user's email address */
     26                printf( esc_html__( 'Email: %s', 'wporg-forums' ), bbp_get_displayed_user_field( 'user_email' ) );
     27            ?></p>
     28
    2429        <?php endif; ?>
     30
     31        <p class="bbp-user-wporg-profile"><?php
     32            $user_nicename  = bbp_get_displayed_user_field( 'user_nicename' );
     33            $slack_username = wporg_support_get_slack_username();
     34
     35            if ( $slack_username && $slack_username != $user_nicename ) {
     36                /* translators: 1: user's WordPress.org profile link, 2: user's Slack username, 3: make.wordpress.org/chat URL */
     37                printf( __( '%1$s on WordPress.org, %2$s on <a href="%3$s">Slack</a>', 'wporg-forums' ),
     38                    wporg_support_get_wporg_profile_link(),
     39                    '@' . $slack_username,
     40                    'https://make.wordpress.org/chat/'
     41                );
     42            } elseif( $slack_username ) {
     43                /* translators: 1: WordPress.org and Slack username, 2: URL for information about Slack */
     44                printf( __( '%1$s on WordPress.org and <a href="%2$s">Slack</a>', 'wporg-forums' ),
     45                    wporg_support_get_wporg_profile_link(),
     46                    'https://make.wordpress.org/chat/'
     47                );
     48            } else {
     49                /* translators: %s: user's WordPress.org profile link */
     50                printf( esc_html__( '%s on WordPress.org', 'wporg-forums' ),
     51                    wporg_support_get_wporg_profile_link()
     52                );
     53            }
     54        ?></p>
    2555
    2656        <?php if ( $custom_title = get_user_option( 'title', bbp_get_displayed_user_id() ) ) : ?>
    2757   
    28             <p class="bbp-user-custom-title"><?php printf( esc_html__( 'Title: %s',       'wporg-forums' ), esc_html( $custom_title )      ); ?></p>
     58            <p class="bbp-user-custom-title"><?php
     59                /* translators: %s: user's custom title */
     60                printf( esc_html__( 'Title: %s', 'wporg-forums' ), esc_html( $custom_title ) );
     61            ?></p>
    2962   
    3063        <?php endif; ?>
    3164
    32         <p class="bbp-user-forum-role"><?php   printf( esc_html__( 'Forum Role: %s',      'wporg-forums' ), bbp_get_user_display_role()    ); ?></p>
    33         <p class="bbp-user-member-since"><?php printf( esc_html__( 'Member Since: %s',    'wporg-forums' ), wporg_support_get_user_registered_date() ); ?></p>
    34         <p class="bbp-user-topic-count"><?php  printf( esc_html__( 'Topics Started: %s',  'wporg-forums' ), bbp_get_user_topic_count_raw() ); ?></p>
    35         <p class="bbp-user-reply-count"><?php  printf( esc_html__( 'Replies Created: %s', 'wporg-forums' ), bbp_get_user_reply_count_raw() ); ?></p>
     65        <p class="bbp-user-forum-role"><?php
     66            /* translators: %s: user's forum role */
     67            printf( esc_html__( 'Forum Role: %s', 'wporg-forums' ), bbp_get_user_display_role() );
     68        ?></p>
     69        <p class="bbp-user-member-since"><?php
     70            /* translators: %s: user's registration date */
     71            printf( esc_html__( 'Member Since: %s', 'wporg-forums' ), wporg_support_get_user_registered_date() );
     72        ?></p>
     73        <p class="bbp-user-topic-count"><?php
     74            /* translators: %s: number of user's topics */
     75            printf( esc_html__( 'Topics Started: %s', 'wporg-forums' ), bbp_get_user_topic_count_raw() );
     76        ?></p>
     77        <p class="bbp-user-reply-count"><?php
     78            /* translators: %s: number of user's replies */
     79            printf( esc_html__( 'Replies Created: %s', 'wporg-forums' ), bbp_get_user_reply_count_raw() );
     80        ?></p>
    3681    </div>
    3782</div><!-- #bbp-author-topics-started -->
Note: See TracChangeset for help on using the changeset viewer.