WordPress.org

Making WordPress.org

Changeset 10584


Ignore:
Timestamp:
01/15/2021 05:48:26 AM (4 months ago)
Author:
dd32
Message:

Support Forums: Remove some details from the support profile overview for blocked users.

See #5578.

File:
1 edited

Legend:

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

    r10495 r10584  
    77 * @subpackage Theme
    88 */
     9
     10$is_user_blocked     = bbpress()->displayed_user->has_cap( bbp_get_blocked_role() );
     11$hide_profile_fields = ( $is_user_blocked && ! current_user_can( 'moderate' ) );
    912
    1013do_action( 'bbp_template_before_user_profile' ); ?>
     
    4952        ?>
    5053
    51         <?php if ( bbp_get_displayed_user_field( 'description' ) ) : ?>
     54        <?php if ( ! $hide_profile_fields && bbp_get_displayed_user_field( 'description' ) ) : ?>
    5255
    5356            <p class="bbp-user-description"><?php bbp_displayed_user_field( 'description' ); ?></p>
     
    8992        ?></p>
    9093
    91         <?php if ( $custom_title = get_user_option( 'title', bbp_get_displayed_user_id() ) ) : ?>
     94        <?php if ( ! $hide_profile_fields && ( $custom_title = get_user_option( 'title', bbp_get_displayed_user_id() ) ) ) : ?>
    9295   
    9396            <p class="bbp-user-custom-title"><?php
     
    98101        <?php endif; ?>
    99102
    100         <p class="bbp-user-forum-role"><?php
    101             /* translators: %s: user's forum role */
    102             printf( esc_html__( 'Forum Role: %s', 'wporg-forums' ), bbp_get_user_display_role() );
    103         ?></p>
     103        <?php
     104            // Only show the forum role when they're privledged, or the current user is privledged.
     105            if (
     106                current_user_can( 'moderate' ) ||
     107                bbpress()->displayed_user->has_cap( bbp_get_moderator_role() ) ||
     108                bbpress()->displayed_user->has_cap( bbp_get_keymaster_role() )
     109            ) {
     110                ?><p class="bbp-user-forum-role"><?php
     111                /* translators: %s: user's forum role */
     112                printf( esc_html__( 'Forum Role: %s', 'wporg-forums' ), bbp_get_user_display_role() );
     113                ?></p><?php
     114            }
     115        ?>
    104116
    105         <?php if ( is_user_logged_in() && $website = bbp_get_displayed_user_field( 'user_url' ) ) : ?>
     117        <?php if ( is_user_logged_in() && ! $hide_profile_fields && ( $website = bbp_get_displayed_user_field( 'user_url' ) ) ) : ?>
    106118   
    107119            <p class="bbp-user-website"><?php
Note: See TracChangeset for help on using the changeset viewer.