Skip to content

Commit bd8ff4a

Browse files
committed
Administration: Fix undeclared variable.
Moved `$updated_notice_args` to be defined before the conditional in which it's used. Props TobiasBg. See #57791. git-svn-id: https://develop.svn.wordpress.org/trunk@56589 602fd350-edb4-49c9-b593-d223f7449a82
1 parent da28362 commit bd8ff4a

1 file changed

Lines changed: 18 additions & 17 deletions

File tree

src/wp-admin/plugins.php

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,12 @@
618618
}
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+
);
621627
if ( isset( $_GET['error'] ) ) {
622628

623629
if ( isset( $_GET['main'] ) ) {
@@ -663,7 +669,7 @@
663669
);
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 );
669675

@@ -682,38 +688,33 @@
682688
)
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.' );
692693
} else {
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
?>
719720

0 commit comments

Comments
 (0)