WordPress.org

Making WordPress.org

Changeset 5170


Ignore:
Timestamp:
03/27/17 19:34:25 (9 months ago)
Author:
coffee2code
Message:

Plugin Directory: Update author card to indicate when user is flagged on the support forums.

Fixes #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

    r5001 r5170  
    6666        if ( defined( 'WPORG_SUPPORT_FORUMS_BLOGID' ) ) { 
    6767            $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>'; 
     68            $statuses = array(); 
     69 
     70            if ( ! empty( $user->allcaps['bbp_blocked'] ) ) { 
     71                $statuses['banned'] = __( 'User is banned from logging into WordPress.org', 'wporg-plugins' ); 
     72            } 
     73 
     74            if ( (bool) get_user_meta( $user->ID, 'is_bozo', true ) ) { 
     75                $statuses['flagged'] = __( 'User is flagged in the support forums', 'wporg-plugins' ); 
     76            } 
     77 
     78            if ( $statuses ) { 
     79                $labels = array(); 
     80                foreach ( $statuses as $status => $desc ) { 
     81                    $labels[] = sprintf( '<strong><span title="%s">%s</span></strong>', esc_attr( $desc ), $status ); 
     82                } 
     83                /* translators: %s: Comma-separated list of negative user status labels */ 
     84                echo '<p>' . sprintf( __( 'This user is: %s', 'wporg-plugins' ), implode( ', ', $labels ) ) . '</p>'; 
     85            } 
    7086        } 
    7187 
Note: See TracChangeset for help on using the changeset viewer.