WordPress.org

Making WordPress.org


Ignore:
Timestamp:
04/11/2016 01:37:50 PM (3 years ago)
Author:
obenland
Message:

Plugin Directory: Allow committer mangament only for active plugins.

Plugins that are not yet live or are deprecated/hidden, should not have
committers added to them.

See #1570.

File:
1 edited

Legend:

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

    r2927 r2929  
    2626    private function __construct() {
    2727        // Admin Metaboxes
    28         add_action( 'add_meta_boxes', array( $this, 'register_admin_metaboxes' ), 10, 1 );
     28        add_action( 'add_meta_boxes', array( $this, 'register_admin_metaboxes' ), 10, 2 );
    2929        add_action( 'do_meta_boxes', array( $this, 'replace_title_global' ) );
    3030
     
    220220     * Register the Admin metaboxes for the plugin management screens.
    221221     *
    222      * @param string $post_type The post type of the current screen.
     222     * @param string   $post_type The post type of the current screen.
     223     * @param \WP_Post $post      Post object.
    223224     * @return void.
    224225     */
    225     public function register_admin_metaboxes( $post_type ) {
     226    public function register_admin_metaboxes( $post_type, $post ) {
    226227        if ( 'plugin' != $post_type ) {
    227228            return;
     
    260261        );
    261262
    262         add_meta_box(
    263             'plugin-committers',
    264             __( 'Plugin Committers', 'wporg-plugins' ),
    265             array( __NAMESPACE__ . '\Metabox\Committers', 'display' ),
    266             'plugin', 'side'
    267         );
     263        if ( 'publish' === $post->post_status ) {
     264            add_meta_box(
     265                'plugin-committers',
     266                __( 'Plugin Committers', 'wporg-plugins' ),
     267                array( __NAMESPACE__ . '\Metabox\Committers', 'display' ),
     268                'plugin', 'side'
     269            );
     270        }
    268271
    269272        // Remove unnecessary metaboxes.
Note: See TracChangeset for help on using the changeset viewer.