|
618 | 618 | } |
619 | 619 | } |
620 | 620 |
|
| 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 | +); |
621 | 627 | if ( isset( $_GET['error'] ) ) { |
622 | 628 |
|
623 | 629 | if ( isset( $_GET['main'] ) ) { |
|
663 | 669 | ); |
664 | 670 |
|
665 | 671 | } elseif ( isset( $_GET['deleted'] ) ) { |
666 | | - $delete_result = get_transient( 'plugins_delete_result_' . $user_ID ); |
| 672 | + $delete_result = get_transient( 'plugins_delete_result_' . $user_ID ); |
667 | 673 | // Delete it once we're done. |
668 | 674 | delete_transient( 'plugins_delete_result_' . $user_ID ); |
669 | 675 |
|
|
682 | 688 | ) |
683 | 689 | ); |
684 | 690 | } else { |
685 | | - $updated_args = array( |
686 | | - 'id' => 'message', |
687 | | - 'additional_classes' => array( 'updated' ), |
688 | | - 'dismissible' => true, |
689 | | - ); |
690 | 691 | if ( 1 === (int) $_GET['deleted'] ) { |
691 | 692 | $plugins_deleted_message = __( 'The selected plugin has been deleted.' ); |
692 | 693 | } else { |
693 | 694 | $plugins_deleted_message = __( 'The selected plugins have been deleted.' ); |
694 | 695 | } |
695 | | - wp_admin_notice( $plugins_deleted_message, $updated_args ); |
| 696 | + wp_admin_notice( $plugins_deleted_message, $updated_notice_args ); |
696 | 697 | } |
697 | 698 | } elseif ( isset( $_GET['activate'] ) ) { |
698 | | - wp_admin_notice( __( 'Plugin activated.' ), $updated_args ); |
| 699 | + wp_admin_notice( __( 'Plugin activated.' ), $updated_notice_args ); |
699 | 700 | } elseif ( isset( $_GET['activate-multi'] ) ) { |
700 | | - wp_admin_notice( __( 'Selected plugins activated.' ), $updated_args ); |
| 701 | + wp_admin_notice( __( 'Selected plugins activated.' ), $updated_notice_args ); |
701 | 702 | } elseif ( isset( $_GET['deactivate'] ) ) { |
702 | | - wp_admin_notice( __( 'Plugin deactivated.' ), $updated_args ); |
| 703 | + wp_admin_notice( __( 'Plugin deactivated.' ), $updated_notice_args ); |
703 | 704 | } elseif ( isset( $_GET['deactivate-multi'] ) ) { |
704 | | - wp_admin_notice( __( 'Selected plugins deactivated.' ), $updated_args ); |
| 705 | + wp_admin_notice( __( 'Selected plugins deactivated.' ), $updated_notice_args ); |
705 | 706 | } 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 ); |
707 | 708 | } elseif ( isset( $_GET['resume'] ) ) { |
708 | | - wp_admin_notice( __( 'Plugin resumed.' ), $updated_args ); |
| 709 | + wp_admin_notice( __( 'Plugin resumed.' ), $updated_notice_args ); |
709 | 710 | } 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 ); |
711 | 712 | } 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 ); |
713 | 714 | } 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 ); |
715 | 716 | } 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 ); |
717 | 718 | } |
718 | 719 | ?> |
719 | 720 |
|
|
0 commit comments