Making WordPress.org

Changeset 11746


Ignore:
Timestamp:
04/05/2022 05:19:22 AM (2 years ago)
Author:
dd32
Message:

Plugin Directory: Display a "no-self-management" notice when a plugin is within the beta/featured categories.

[11744] included some code to require reviewer caps for plugins within those categories for certain actions:
https://meta.trac.wordpress.org/browser/sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-capabilities.php?rev=11744&marks=65-79#L61

See #5654.

Location:
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins
Files:
2 edited

Legend:

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

    r11745 r11746  
    296296}
    297297
     298function the_no_self_management_notice() {
     299    $post = get_post();
     300
     301    // Check if they can access plugin management, but can't add committers.
     302    // This means the plugin has limited self-management functionalities, for security.
     303    if (
     304        current_user_can( 'plugin_admin_edit', $post ) &&
     305        ! current_user_can( 'plugin_add_committer', $post )
     306    ) {
     307        printf(
     308            '<div class="plugin-notice notice notice-warning notice-alt"><p>%s</p></div>',
     309            __( 'Management of this plugin has been limited for security reasons. Please contact the plugins team for assistance to add/remove committers, or to perform other actions that are unavailable.', 'wporg-plugins' )
     310        );
     311    }
     312}
     313
    298314/**
    299315 * Display the ADVANCED Zone.
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/template-parts/section-advanced.php

    r9784 r11746  
    1717<div id="admin" class="section">
    1818    <?php the_closed_plugin_notice(); ?>
     19    <?php the_no_self_management_notice(); ?>
    1920
    2021    <h2><?php esc_html_e( 'Statistics', 'wporg-plugins' ); ?></h2>
Note: See TracChangeset for help on using the changeset viewer.