Making WordPress.org

Changeset 12595


Ignore:
Timestamp:
05/18/2023 03:40:30 AM (13 months ago)
Author:
dd32
Message:

HelpScout: Plugins: Display who the plugin is assigned to, if assigned to anyone.

See #6993.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/api.wordpress.org/public_html/dotorg/helpscout/plugins-themes.php

    r12496 r12595  
    140140        $post_status = '';
    141141        $style       = 'color: green;';
     142        $reviewer    = false;
     143        if ( 'plugin' === $post->post_type && $post->assigned_reviewer ) {
     144            $reviewer_user = get_user_by( 'id', $post->assigned_reviewer );
     145            $reviewer      = $reviewer_user->display_name ?: $reviewer_user->user_login;
     146        }
    142147
    143148        switch ( $post->post_status ) {
     
    149154            case 'closed':
    150155            case 'disabled':
    151                 $post_status = '(Closed)';
     156                $post_status = '(' . ucwords( $post->post_status ) . ')';
    152157                $style       = 'color: red;';
    153158                break;
     
    175180                $style       = 'color: red;';
    176181                break;
     182        }
     183
     184        // Append assigned to, if known.
     185        if ( $reviewer ) {
     186            $post_status = str_replace( ')', ", Assigned to {$reviewer})", $post_status );
    177187        }
    178188
Note: See TracChangeset for help on using the changeset viewer.