Making WordPress.org


Ignore:
Timestamp:
05/05/2016 08:45:51 PM (9 years ago)
Author:
obenland
Message:

Plugin Directory: Allow Plugin Admins to edit slugs.

Let's Admins change plugin slugs as long as they've not been approved yet.

Fixes #1686.

File:
1 edited

Legend:

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

    r3037 r3091  
    307307
    308308        // Remove unnecessary metaboxes.
    309         remove_meta_box( 'slugdiv',          'plugin', 'normal' );
    310309        remove_meta_box( 'commentsdiv',      'plugin', 'normal' );
    311310        remove_meta_box( 'commentstatusdiv', 'plugin', 'normal' );
     311
     312        // Remove slug metabox unless the slug is editable for the current user.
     313        if ( ! in_array( $post->post_status, array( 'draft', 'pending' ) ) || ! current_user_can( 'plugin_approve', $post ) ) {
     314            remove_meta_box( 'slugdiv', 'plugin', 'normal' );
     315        }
    312316    }
    313317
Note: See TracChangeset for help on using the changeset viewer.