Making WordPress.org


Ignore:
Timestamp:
01/03/2017 03:19:15 AM (8 years ago)
Author:
dd32
Message:

Plugin Directory: Update the user cards to support bbPressv2.

Props ipstenu.
See #2351.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/metabox/class-author-card.php

    r4223 r4605  
    4646                <span class="profile-links">
    4747                    <a href="//profiles.wordpress.org/<?php echo $author->user_nicename; ?>">profile</a> |
    48                     <a href="//wordpress.org/support/profile/<?php echo $author->user_nicename; ?>">support</a>
     48                    <a href="//wordpress.org/support/users/<?php echo $author->user_nicename; ?>">support</a>
    4949                </span>
    5050                <span class="profile-email">
     
    6464            endif;
    6565
    66         $unsavory = array();
    67         if ( property_exists( $author, 'capabilities' ) && isset( $author->capabilities['blocked'] ) && '1' == $author->capabilities['blocked'] ) {
    68             $unsavory[] = '<span title="User is banned from logging into WordPress.org">banned</span>';
    69         }
    70         if ( property_exists( $author, 'elf_not_trusted' ) && '1' == $author->elf_not_trusted ) {
    71             $unsavory[] = '<span title="User has been blocked from being able to post in the forums">blocked</span>';
    72         }
    73         if ( property_exists( $author, 'is_bozo' ) && '1' == $author->is_bozo ) {
    74             $unsavory[] = '<span title="User has been flagged by forum moderators as being problematic">a bozo</span>';
    75         }
    76 
    77         if ( $unsavory ) {
    78             echo '<p>This user is: <strong>' . implode( ', ', $unsavory ) . '</strong></p>';
     66        if ( defined( 'WPORG_SUPPORT_FORUMS_BLOGID' ) ) {
     67            $user = new \WP_User( $author, '', WPORG_SUPPORT_FORUMS_BLOGID );
     68            if ( ! empty( $user->allcaps['bbp_blocked'] ) )
     69                echo '<p>This user is: <strong><span title="User is banned from logging into WordPress.org">banned</span></strong></p>';
    7970        }
    8071
Note: See TracChangeset for help on using the changeset viewer.