Make WordPress Core


Ignore:
Timestamp:
09/14/2023 05:10:25 PM (3 months ago)
Author:
joedolson
Message:

Administration: Fix undeclared variable.

Moved $updated_notice_args to be defined before the conditional in which it's used.

Props TobiasBg.
See #57791.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/plugins.php

    r56573 r56589  
    619619}
    620620
     621// Used by wp_admin_notice() updated notices.
     622$updated_notice_args = array(
     623    'id'                 => 'message',
     624    'additional_classes' => array( 'updated' ),
     625    'dismissible'        => true,
     626);
    621627if ( isset( $_GET['error'] ) ) {
    622628
     
    664670
    665671} elseif ( isset( $_GET['deleted'] ) ) {
    666     $delete_result = get_transient( 'plugins_delete_result_' . $user_ID );
     672    $delete_result       = get_transient( 'plugins_delete_result_' . $user_ID );
    667673    // Delete it once we're done.
    668674    delete_transient( 'plugins_delete_result_' . $user_ID );
     
    683689        );
    684690    } else {
    685         $updated_args = array(
    686             'id'                 => 'message',
    687             'additional_classes' => array( 'updated' ),
    688             'dismissible'        => true,
    689         );
    690691        if ( 1 === (int) $_GET['deleted'] ) {
    691692            $plugins_deleted_message = __( 'The selected plugin has been deleted.' );
     
    693694            $plugins_deleted_message = __( 'The selected plugins have been deleted.' );
    694695        }
    695         wp_admin_notice( $plugins_deleted_message, $updated_args );
     696        wp_admin_notice( $plugins_deleted_message, $updated_notice_args );
    696697    }
    697698} elseif ( isset( $_GET['activate'] ) ) {
    698     wp_admin_notice( __( 'Plugin activated.' ), $updated_args );
     699    wp_admin_notice( __( 'Plugin activated.' ), $updated_notice_args );
    699700} elseif ( isset( $_GET['activate-multi'] ) ) {
    700     wp_admin_notice( __( 'Selected plugins activated.' ), $updated_args );
     701    wp_admin_notice( __( 'Selected plugins activated.' ), $updated_notice_args );
    701702} elseif ( isset( $_GET['deactivate'] ) ) {
    702     wp_admin_notice( __( 'Plugin deactivated.' ), $updated_args );
     703    wp_admin_notice( __( 'Plugin deactivated.' ), $updated_notice_args );
    703704} elseif ( isset( $_GET['deactivate-multi'] ) ) {
    704     wp_admin_notice( __( 'Selected plugins deactivated.' ), $updated_args );
     705    wp_admin_notice( __( 'Selected plugins deactivated.' ), $updated_notice_args );
    705706} elseif ( 'update-selected' === $action ) {
    706     wp_admin_notice( __( 'All selected plugins are up to date.' ), $updated_args );
     707    wp_admin_notice( __( 'All selected plugins are up to date.' ), $updated_notice_args );
    707708} elseif ( isset( $_GET['resume'] ) ) {
    708     wp_admin_notice( __( 'Plugin resumed.' ), $updated_args );
     709    wp_admin_notice( __( 'Plugin resumed.' ), $updated_notice_args );
    709710} elseif ( isset( $_GET['enabled-auto-update'] ) ) {
    710     wp_admin_notice( __( 'Plugin will be auto-updated.' ), $updated_args );
     711    wp_admin_notice( __( 'Plugin will be auto-updated.' ), $updated_notice_args );
    711712} elseif ( isset( $_GET['disabled-auto-update'] ) ) {
    712     wp_admin_notice( __( 'Plugin will no longer be auto-updated.' ), $updated_args );
     713    wp_admin_notice( __( 'Plugin will no longer be auto-updated.' ), $updated_notice_args );
    713714} elseif ( isset( $_GET['enabled-auto-update-multi'] ) ) {
    714     wp_admin_notice( __( 'Selected plugins will be auto-updated.' ), $updated_args );
     715    wp_admin_notice( __( 'Selected plugins will be auto-updated.' ), $updated_notice_args );
    715716} elseif ( isset( $_GET['disabled-auto-update-multi'] ) ) {
    716     wp_admin_notice( __( 'Selected plugins will no longer be auto-updated.' ), $updated_args );
     717    wp_admin_notice( __( 'Selected plugins will no longer be auto-updated.' ), $updated_notice_args );
    717718}
    718719?>
Note: See TracChangeset for help on using the changeset viewer.