Making WordPress.org


Ignore:
Timestamp:
06/15/2017 02:05:54 PM (7 years ago)
Author:
Otto42
Message:

Plugin Directory: Change edit actions dropdown to buttons with specific states. props @SergeyBiryukov. Fixes #2796

File:
1 edited

Legend:

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

    r5335 r5573  
    3333        add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_assets' ) );
    3434        add_filter( 'admin_head-edit.php', array( $this, 'plugin_posts_list_table' ) );
     35        add_filter( 'post_row_actions', array( $this, 'plugin_row_actions' ) );
    3536        add_action( 'edit_form_top', array( $this, 'show_permalink' ) );
    3637        add_action( 'admin_notices', array( $this, 'add_post_status_notice' ) );
     
    112113                    wp_enqueue_script( 'plugin-admin-post-js', plugins_url( 'js/edit-form.js', Plugin_Directory\PLUGIN_FILE ), array( 'wp-util', 'wp-lists' ), 3 );
    113114                    wp_localize_script( 'plugin-admin-post-js', 'pluginDirectory', array(
     115                        'approvePluginAYS'   => __( 'Are you sure you want to approve this plugin?', 'wporg-plugins' ),
     116                        'rejectPluginAYS'    => __( 'Are you sure you want to reject this plugin?', 'wporg-plugins' ),
    114117                        'removeCommitterAYS' => __( 'Are you sure you want to remove this committer?', 'wporg-plugins' ),
    115118                    ) );
     
    160163            $wp_list_table->prepare_items();
    161164        }
     165    }
     166
     167    /**
     168     * Disables Quick Edit for plugins.
     169     *
     170     * @param array $actions An array of row action links.
     171     * @return array Filtered array of row action links.
     172     */
     173    public function plugin_row_actions( $actions ) {
     174        global $post_type;
     175
     176        if ( 'plugin' === $post_type ) {
     177            unset( $actions['inline hide-if-no-js'] );
     178        }
     179
     180        return $actions;
    162181    }
    163182
Note: See TracChangeset for help on using the changeset viewer.