WordPress.org

Make WordPress Core


Ignore:
Timestamp:
11/30/2018 04:22:46 PM (3 years ago)
Author:
melchoyce
Message:

Help/About: Fix the user's saved WordPress.org username from being changed to wordpressdotorg when they click the About page link to install the Classic Editor plugin.

Props pento.
See #45178.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/5.0/src/wp-admin/includes/class-wp-plugin-install-list-table.php

    r41916 r43952  
    191191                if ( isset( $_GET['_wpnonce'] ) && wp_verify_nonce( wp_unslash( $_GET['_wpnonce'] ), $action ) ) {
    192192                    $user = isset( $_GET['user'] ) ? wp_unslash( $_GET['user'] ) : get_user_option( 'wporg_favorites' );
    193                     update_user_meta( get_current_user_id(), 'wporg_favorites', $user );
     193
     194                    // If the save url parameter is passed with a falsey value, don't save the favorite user.
     195                    if ( ! isset( $_GET['save'] ) || $_GET['save'] ) {
     196                        update_user_meta( get_current_user_id(), 'wporg_favorites', $user );
     197                    }
    194198                } else {
    195199                    $user = get_user_option( 'wporg_favorites' );
Note: See TracChangeset for help on using the changeset viewer.