Making WordPress.org


Ignore:
Timestamp:
01/07/2019 04:26:56 AM (6 years ago)
Author:
dd32
Message:

Plugin Directory: Hide most Widgets & Tags for non-privledged users when a plugin is closed.

This continues to show all widgets (including tags) on the Advanced view for privledged users, but hides it for all logged out and non-privledged users.

Fixes #4036.

File:
1 edited

Legend:

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

    r7035 r8032  
    106106
    107107    <div class="entry-meta">
    108         <?php get_template_part( 'template-parts/plugin-sidebar', get_query_var( 'plugin_advanced' ) ? 'advanced' : '' ); ?>
     108        <?php
     109            if ( get_query_var( 'plugin_advanced' ) && ( ! $is_closed || current_user_can( 'plugin_admin_view', $post ) ) ) {
     110                get_template_part( 'template-parts/plugin-sidebar', 'advanced' );
     111            } elseif ( $is_closed ) {
     112                get_template_part( 'template-parts/plugin-sidebar', 'closed' );
     113            } else {
     114                get_template_part( 'template-parts/plugin-sidebar' );
     115            }
     116        ?>
    109117    </div><!-- .entry-meta -->
    110118</article><!-- #post-## -->
Note: See TracChangeset for help on using the changeset viewer.