Making WordPress.org

Changeset 9723


Ignore:
Timestamp:
04/15/2020 01:46:18 AM (5 years ago)
Author:
dd32
Message:

Plugin Directory: Hide the Danger Zone for users who do not have edit on the plugin.

This prevents showing the intro text to everyone, even when there exist no tasks they can perform.

See https://wordpress.slack.com/archives/C02QB8GMM/p1586881237228300

File:
1 edited

Legend:

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

    r9702 r9723  
    4242    <?php the_previous_version_download(); ?>
    4343
    44     <hr>
     44    <?php if ( current_user_can( 'plugin_admin_edit', $post ) && 'publish' == $post->post_status ) : ?>
     45        <hr>
    4546
    46     <h2><?php esc_html_e( 'The Danger Zone', 'wporg-plugins' ); ?></h2>
     47        <h2><?php esc_html_e( 'The Danger Zone', 'wporg-plugins' ); ?></h2>
    4748
    48     <p><?php esc_html_e( 'The following features are restricted to plugin committers only. They exist to allow plugin developers more control over their work.', 'wporg-plugins' ); ?></p>
     49        <p><?php esc_html_e( 'The following features are restricted to plugin committers only. They exist to allow plugin developers more control over their work.', 'wporg-plugins' ); ?></p>
    4950
    50     <div class="plugin-notice notice notice-error notice-alt"><p><?php esc_html_e( 'These features often cannot be undone without intervention. Please do not attempt to use them unless you are absolutely certain. When in doubt, contact the plugins team for assistance.', 'wporg-plugins' ); ?></p></div>
     51        <div class="plugin-notice notice notice-error notice-alt"><p><?php esc_html_e( 'These features often cannot be undone without intervention. Please do not attempt to use them unless you are absolutely certain. When in doubt, contact the plugins team for assistance.', 'wporg-plugins' ); ?></p></div>
    5152
    52     <?php the_plugin_self_transfer_form(); ?>
     53        <?php the_plugin_self_transfer_form(); ?>
    5354
    54     <?php the_plugin_self_close_button(); ?>
    55 
     55        <?php the_plugin_self_close_button(); ?>
     56    <?php endif; // current_user_can ?>
    5657</div>
Note: See TracChangeset for help on using the changeset viewer.