Making WordPress.org


Ignore:
Timestamp:
04/05/2022 05:19:22 AM (3 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.

File:
1 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.
Note: See TracChangeset for help on using the changeset viewer.