Making WordPress.org

Changeset 12518


Ignore:
Timestamp:
03/30/2023 03:52:03 AM (21 months ago)
Author:
dd32
Message:

Plugin Directory: When a plugin is closed/disabled, list the reason it's closed on the plugin list view.

See #6903.

File:
1 edited

Legend:

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

    r12517 r12518  
    44use \WordPressdotorg\Plugin_Directory;
    55use \WordPressdotorg\Plugin_Directory\Tools;
     6use \WordPressdotorg\Plugin_Directory\Template;
    67use \WordPressdotorg\Plugin_Directory\Readme\Validator;
    78use \WordPressdotorg\Plugin_Directory\Admin\List_Table\Plugin_Posts;
     
    403404        if ( 'disabled' == $post->post_status && 'disabled' != $post_status ) {
    404405            $post_states['disabled'] = _x( 'Disabled', 'plugin status', 'wporg-plugins' );
     406            // Affix the reason it's disabled.
     407            $reason = Template::get_close_reason( $post );
     408            if ( $reason ) {
     409                $post_states['reason'] = $reason;
     410            }
    405411        }
    406412        if ( 'closed' == $post->post_status && 'closed' != $post_status ) {
    407413            $post_states['closed'] = _x( 'Closed', 'plugin status', 'wporg-plugins' );
     414            // Affix the reason it's closed.
     415            $reason = Template::get_close_reason( $post );
     416            if ( $reason ) {
     417                $post_states['reason'] = $reason;
     418            }
    408419        }
    409420        if ( 'rejected' == $post->post_status && 'rejected' != $post_status ) {
Note: See TracChangeset for help on using the changeset viewer.