Making WordPress.org


Ignore:
Timestamp:
10/11/2016 06:42:46 AM (8 years ago)
Author:
dd32
Message:

Plugin Directory: Allow non-published plugins to be viewed on the front-end by reviewers and contributors/commiters/submitters of the plugin.

This also adds a notice on the top of plugin pages with the status of the plugin.

See #2111.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/template-parts/plugin-single.php

    r4200 r4213  
    2828            <div class="plugin-notice notice notice-warning notice-alt">
    2929                <p><?php _e( 'This plugin <strong>hasn&#146;t been updated in over 2 years</strong>. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.', 'wporg-plugins' ); ?></p>
     30            </div><!-- .plugin-notice -->
     31        <?php endif; ?>
     32        <?php if ( 'publish' != get_post()->post_status ) :
     33                $notice_type = 'notice-error';
     34                switch ( get_post()->post_status ) {
     35                    case 'draft':
     36                    case 'pending':
     37                        $message = __( 'This plugin is requested and not visible to the public yet. Please be patient as your plugin gets reviewed.', 'wporg-plugins' );
     38                        $notice_type = 'notice-info';
     39                        break;
     40
     41                    case 'approved':
     42                        $message = __( 'This plugin is approved and awaiting data upload but not visible to the public yet. Once you make your first commit, the plugin will become public.', 'wporg-plugins' );
     43                        $notice_type = 'notice-info';
     44                        break;
     45
     46                    case 'rejected':
     47                        $message = __( 'This plugin is rejected and is not visible to the public.', 'wporg-plugins' );
     48                        break;
     49
     50                    case 'disabled':
     51                        if ( current_user_can( 'plugin_approve' ) ) {
     52                            $message = __( 'This plugin is disabled (closed, but actively serving updates) and is not visible to the public.', 'wporg-plugins' );
     53                            break;
     54                        }
     55                        // fall through
     56                    default:
     57                    case 'closed':
     58                        $message = __( 'This plugin is closed and is not visible to the public.', 'wporg-plugins' );
     59                        break;
     60                }
     61            ?>
     62            <div class="plugin-notice notice <?php echo esc_attr( $notice_type ); ?> notice-alt">
     63                <p><?php echo $message; ?></p>
    3064            </div><!-- .plugin-notice -->
    3165        <?php endif; ?>
Note: See TracChangeset for help on using the changeset viewer.