WordPress.org

Making WordPress.org


Ignore:
Timestamp:
11/23/2017 02:08:54 AM (8 months ago)
Author:
SergeyBiryukov
Message:

Plugin Directory, Author Card: Display close reason for closed or disabled plugins.

Fixes #3278.

File:
1 edited

Legend:

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

    r5556 r6162  
    44require_once dirname( dirname( __DIR__ ) ) . '/class-tools.php';
    55
     6use WordPressdotorg\Plugin_Directory\Template;
    67use WordPressdotorg\Plugin_Directory\Tools;
    78
     
    153154                    $plugin_slug = $plugin->post_name;
    154155                    if ( in_array( $plugin->post_status, array( 'new', 'pending' ) ) ) {
    155                         $extra .= ' (requested ' . human_time_diff( strtotime( $last_updated ) ) . ' ago)';
     156                        $extra .= sprintf( '(requested %s ago)', human_time_diff( strtotime( $last_updated ) ) );
    156157                        $tooltips[] = 'Requested, remains unapproved.';
    157158                        $classes[]  = 'profile-plugin-requested';
     
    163164
    164165                    } elseif ( 'closed' === $plugin->post_status ) {
     166                        $extra .= sprintf( '(closed: %s)', Template::get_close_reason( $plugin ) );
    165167                        $tooltips[] = 'Plugin is closed.';
    166168                        $classes[]  = 'profile-plugin-closed';
    167169
    168170                    } elseif ( 'disabled' === $plugin->post_status ) {
     171                        $extra .= sprintf( '(disabled: %s)', Template::get_close_reason( $plugin ) );
    169172                        $tooltips[] = 'Plugin is disabled (updates are active).';
    170173                        $classes[]  = 'profile-plugin-closed';
     
    206209
    207210                    if ( $extra ) {
    208                         echo $extra;
     211                        echo ' ' . $extra;
    209212                    }
    210213
Note: See TracChangeset for help on using the changeset viewer.