From 3ce9440a010b0b806a42c99b581e1cbdc911ae26 Mon Sep 17 00:00:00 2001 From: joedolson Date: Thu, 14 Sep 2023 17:12:20 +0000 Subject: [PATCH] Administration: Fix undeclared variable. Moved `$updated_notice_args` to be defined before the conditional in which it's used. Props TobiasBg. See #57791. Built from https://develop.svn.wordpress.org/trunk@56589 git-svn-id: http://core.svn.wordpress.org/trunk@56101 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/plugins.php | 35 ++++++++++++++++++----------------- wp-includes/version.php | 2 +- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/wp-admin/plugins.php b/wp-admin/plugins.php index f80dda08ed..ea088da98a 100644 --- a/wp-admin/plugins.php +++ b/wp-admin/plugins.php @@ -618,6 +618,12 @@ if ( ! empty( $invalid ) ) { } } +// Used by wp_admin_notice() updated notices. +$updated_notice_args = array( + 'id' => 'message', + 'additional_classes' => array( 'updated' ), + 'dismissible' => true, +); if ( isset( $_GET['error'] ) ) { if ( isset( $_GET['main'] ) ) { @@ -663,7 +669,7 @@ if ( isset( $_GET['error'] ) ) { ); } elseif ( isset( $_GET['deleted'] ) ) { - $delete_result = get_transient( 'plugins_delete_result_' . $user_ID ); + $delete_result = get_transient( 'plugins_delete_result_' . $user_ID ); // Delete it once we're done. delete_transient( 'plugins_delete_result_' . $user_ID ); @@ -682,38 +688,33 @@ if ( isset( $_GET['error'] ) ) { ) ); } else { - $updated_args = array( - 'id' => 'message', - 'additional_classes' => array( 'updated' ), - 'dismissible' => true, - ); if ( 1 === (int) $_GET['deleted'] ) { $plugins_deleted_message = __( 'The selected plugin has been deleted.' ); } else { $plugins_deleted_message = __( 'The selected plugins have been deleted.' ); } - wp_admin_notice( $plugins_deleted_message, $updated_args ); + wp_admin_notice( $plugins_deleted_message, $updated_notice_args ); } } elseif ( isset( $_GET['activate'] ) ) { - wp_admin_notice( __( 'Plugin activated.' ), $updated_args ); + wp_admin_notice( __( 'Plugin activated.' ), $updated_notice_args ); } elseif ( isset( $_GET['activate-multi'] ) ) { - wp_admin_notice( __( 'Selected plugins activated.' ), $updated_args ); + wp_admin_notice( __( 'Selected plugins activated.' ), $updated_notice_args ); } elseif ( isset( $_GET['deactivate'] ) ) { - wp_admin_notice( __( 'Plugin deactivated.' ), $updated_args ); + wp_admin_notice( __( 'Plugin deactivated.' ), $updated_notice_args ); } elseif ( isset( $_GET['deactivate-multi'] ) ) { - wp_admin_notice( __( 'Selected plugins deactivated.' ), $updated_args ); + wp_admin_notice( __( 'Selected plugins deactivated.' ), $updated_notice_args ); } elseif ( 'update-selected' === $action ) { - wp_admin_notice( __( 'All selected plugins are up to date.' ), $updated_args ); + wp_admin_notice( __( 'All selected plugins are up to date.' ), $updated_notice_args ); } elseif ( isset( $_GET['resume'] ) ) { - wp_admin_notice( __( 'Plugin resumed.' ), $updated_args ); + wp_admin_notice( __( 'Plugin resumed.' ), $updated_notice_args ); } elseif ( isset( $_GET['enabled-auto-update'] ) ) { - wp_admin_notice( __( 'Plugin will be auto-updated.' ), $updated_args ); + wp_admin_notice( __( 'Plugin will be auto-updated.' ), $updated_notice_args ); } elseif ( isset( $_GET['disabled-auto-update'] ) ) { - wp_admin_notice( __( 'Plugin will no longer be auto-updated.' ), $updated_args ); + wp_admin_notice( __( 'Plugin will no longer be auto-updated.' ), $updated_notice_args ); } elseif ( isset( $_GET['enabled-auto-update-multi'] ) ) { - wp_admin_notice( __( 'Selected plugins will be auto-updated.' ), $updated_args ); + wp_admin_notice( __( 'Selected plugins will be auto-updated.' ), $updated_notice_args ); } elseif ( isset( $_GET['disabled-auto-update-multi'] ) ) { - wp_admin_notice( __( 'Selected plugins will no longer be auto-updated.' ), $updated_args ); + wp_admin_notice( __( 'Selected plugins will no longer be auto-updated.' ), $updated_notice_args ); } ?> diff --git a/wp-includes/version.php b/wp-includes/version.php index ac34026836..9f8352a55d 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.4-alpha-56588'; +$wp_version = '6.4-alpha-56589'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.