Making WordPress.org

Changeset 10204


Ignore:
Timestamp:
08/26/2020 01:56:46 AM (4 years ago)
Author:
tellyworth
Message:

Plugin dir: fix the Add/Remove buttons.

The Test button was interfering with admin users.

See #5303.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-block-validator.php

    r10203 r10204  
    146146    protected static function handle_test() {
    147147        $post = get_post( intval( $_POST['plugin-id'] ) );
    148         if ( $post && 'test' === $_POST['block-directory-test'] && wp_verify_nonce( $_POST['block-directory-nonce'], 'block-directory-test-' . $post->ID ) ) {
     148        if ( $post && 'test' === $_POST['block-directory-test'] && wp_verify_nonce( $_POST['block-directory-test-nonce'], 'block-directory-test-' . $post->ID ) ) {
    149149            if ( wp_cache_get( "plugin-e2e-test-{$post->ID}", 'plugin-test' ) ) {
    150150                echo '<div class="notice notice-warning notice-alt"><p>' . __( 'Test already in progress.', 'wporg-plugins' ) . '</p></div>';
     
    195195
    196196        if ( current_user_can( 'edit_post', $post->ID ) ) {
    197             echo wp_nonce_field( 'block-directory-test-' . $plugin->ID, 'block-directory-nonce' );
     197            echo wp_nonce_field( 'block-directory-test-' . $plugin->ID, 'block-directory-test-nonce' );
    198198            // translators: %s plugin title.
    199199            $disabled = ( wp_cache_get( "plugin-e2e-test-{$plugin->ID}", 'plugin-test' ) ? ' disabled="disabled"' : '' );
Note: See TracChangeset for help on using the changeset viewer.