From 34e52b90e96d996d4d7182872e59f0cf2f7682a0 Mon Sep 17 00:00:00 2001 From: Mel Choyce Date: Fri, 30 Nov 2018 16:23:46 +0000 Subject: [PATCH] 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. Built from https://develop.svn.wordpress.org/branches/5.0@43952 git-svn-id: http://core.svn.wordpress.org/branches/5.0@43784 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/about.php | 2 +- wp-admin/includes/class-wp-plugin-install-list-table.php | 6 +++++- wp-includes/blocks/latest-comments.php | 2 +- wp-includes/version.php | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/wp-admin/about.php b/wp-admin/about.php index 22ec200fa0..a3c9e94fe0 100644 --- a/wp-admin/about.php +++ b/wp-admin/about.php @@ -335,7 +335,7 @@ include( ABSPATH . 'wp-admin/admin-header.php' );

- +
diff --git a/wp-admin/includes/class-wp-plugin-install-list-table.php b/wp-admin/includes/class-wp-plugin-install-list-table.php index 9bcf652f61..efcbfab480 100644 --- a/wp-admin/includes/class-wp-plugin-install-list-table.php +++ b/wp-admin/includes/class-wp-plugin-install-list-table.php @@ -190,7 +190,11 @@ class WP_Plugin_Install_List_Table extends WP_List_Table { $action = 'save_wporg_username_' . get_current_user_id(); if ( isset( $_GET['_wpnonce'] ) && wp_verify_nonce( wp_unslash( $_GET['_wpnonce'] ), $action ) ) { $user = isset( $_GET['user'] ) ? wp_unslash( $_GET['user'] ) : get_user_option( 'wporg_favorites' ); - update_user_meta( get_current_user_id(), 'wporg_favorites', $user ); + + // If the save url parameter is passed with a falsey value, don't save the favorite user. + if ( ! isset( $_GET['save'] ) || $_GET['save'] ) { + update_user_meta( get_current_user_id(), 'wporg_favorites', $user ); + } } else { $user = get_user_option( 'wporg_favorites' ); } diff --git a/wp-includes/blocks/latest-comments.php b/wp-includes/blocks/latest-comments.php index 80fa24be25..29e17e9de5 100644 --- a/wp-includes/blocks/latest-comments.php +++ b/wp-includes/blocks/latest-comments.php @@ -5,7 +5,7 @@ * @package WordPress */ -if ( ! function_exists( 'wp_latest_comments_draft_or_post_title' ) ) { +if ( ! function_exists( 'gutenberg_draft_or_post_title' ) ) { /** * Get the post title. * diff --git a/wp-includes/version.php b/wp-includes/version.php index 898f9c4c19..652caf52d0 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '5.0-RC1-43951'; +$wp_version = '5.0-RC1-43952'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.