Making WordPress.org

Changeset 8032

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.

Location:
sites/trunk/wordpress.org/public_html/wp-content
Files:
2 edited
1 copied

Legend:

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

    r7631 r8032  
    186186            ?>
    187187
    188             <?php if ( $tags = get_the_term_list( $post->ID, 'plugin_tags', '<div class="tags">', '', '</div>' ) ) : ?>
     188            <?php if ( $tags = get_the_term_list( $post->ID, 'plugin_tags', '<div class="tags">', '', '</div>' ) ) : ?>
    189189                <li class="clear">
    190190                    <?php
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/template-parts/plugin-sidebar-closed.php

    r8028 r8032  
    11<?php
    22/**
    3  * Template part for displaying the Plugin Sidebar.
     3 * Template part for displaying Plugin Sidebar.
    44 *
    55 * @link https://codex.wordpress.org/Template_Hierarchy
     
    1515);
    1616
    17 the_widget( 'WordPressdotorg\Plugin_Directory\Widgets\Meta', array(), $widget_args );
    18 the_widget( 'WordPressdotorg\Plugin_Directory\Widgets\Ratings', array(), $widget_args );
    19 the_widget( 'WordPressdotorg\Plugin_Directory\Widgets\Contributors', array(), array(
    20     'before_title'  => '<h4 class="widget-title">',
    21     'after_title'   => '</h4>',
    22     'before_widget' => '<div id="plugin-contributors" class="widget plugin-contributors">',
    23     'after_widget'  => '</div>',
    24 ) );
    25 the_widget( 'WordPressdotorg\Plugin_Directory\Widgets\Support', array(), $widget_args );
    26 the_widget( 'WordPressdotorg\Plugin_Directory\Widgets\Donate', array(), $widget_args );
     17the_widget( 'WordPressdotorg\Plugin_Directory\Widgets\Meta', array(), $widget_args + array( 'hide_tags' => true ) );
  • 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.