diff --git src/js/_enqueues/wp/updates.js src/js/_enqueues/wp/updates.js
index dc342f2..7243f0e 100644
|
|
|
2137 | 2137 | * @param {Event} event Event interface. |
2138 | 2138 | */ |
2139 | 2139 | $bulkActionForm.on( 'click', '[data-plugin] a.delete', function( event ) { |
2140 | | var $pluginRow = $( event.target ).parents( 'tr' ), |
2141 | | confirmMessage = sprintf( |
| 2140 | var $pluginRow = $( event.target ).parents( 'tr' ); |
| 2141 | |
| 2142 | if($(event.target).hasClass('no-plugin-data')){ |
| 2143 | var confirmMessage = sprintf( |
| 2144 | /* translators: %s: Plugin name. */ |
| 2145 | __( 'Are you sure you want to delete %s? If the plugin has data, this will not be deleted.' ), |
| 2146 | $pluginRow.find( '.plugin-title strong' ).text() |
| 2147 | ); |
| 2148 | } else { |
| 2149 | var confirmMessage = sprintf( |
2142 | 2150 | /* translators: %s: Plugin name. */ |
2143 | 2151 | __( 'Are you sure you want to delete %s and its data?' ), |
2144 | 2152 | $pluginRow.find( '.plugin-title strong' ).text() |
2145 | 2153 | ); |
2146 | | |
| 2154 | } |
2147 | 2155 | event.preventDefault(); |
2148 | 2156 | |
2149 | 2157 | if ( ! window.confirm( confirmMessage ) ) { |
diff --git src/wp-admin/includes/class-wp-plugins-list-table.php src/wp-admin/includes/class-wp-plugins-list-table.php
index f257354..3e4b8e0 100644
|
|
class WP_Plugins_List_Table extends WP_List_Table { |
758 | 758 | } |
759 | 759 | |
760 | 760 | if ( current_user_can( 'delete_plugins' ) && ! is_plugin_active( $plugin_file ) ) { |
| 761 | |
| 762 | $has_plugin_data = is_uninstallable_plugin($plugin_file) ? "has-plugin-data" : "no-plugin-data"; |
| 763 | |
761 | 764 | $actions['delete'] = sprintf( |
762 | | '<a href="%s" id="delete-%s" class="delete" aria-label="%s">%s</a>', |
| 765 | '<a href="%s" id="delete-%s" class="delete%s" aria-label="%s">%s</a>', |
763 | 766 | wp_nonce_url( 'plugins.php?action=delete-selected&checked[]=' . urlencode( $plugin_file ) . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'bulk-plugins' ), |
764 | 767 | esc_attr( $plugin_slug ), |
| 768 | " $has_plugin_data", |
765 | 769 | /* translators: %s: Plugin name. */ |
766 | 770 | esc_attr( sprintf( _x( 'Delete %s', 'plugin' ), $plugin_data['Name'] ) ), |
767 | 771 | __( 'Delete' ) |
… |
… |
class WP_Plugins_List_Table extends WP_List_Table { |
812 | 816 | } |
813 | 817 | |
814 | 818 | if ( ! is_multisite() && current_user_can( 'delete_plugins' ) ) { |
| 819 | |
| 820 | $has_plugin_data = is_uninstallable_plugin($plugin_file) ? "has-plugin-data" : "no-plugin-data"; |
| 821 | |
815 | 822 | $actions['delete'] = sprintf( |
816 | | '<a href="%s" id="delete-%s" class="delete" aria-label="%s">%s</a>', |
| 823 | '<a href="%s" id="delete-%s" class="delete%s" aria-label="%s">%s</a>', |
817 | 824 | wp_nonce_url( 'plugins.php?action=delete-selected&checked[]=' . urlencode( $plugin_file ) . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'bulk-plugins' ), |
818 | 825 | esc_attr( $plugin_slug ), |
| 826 | " $has_plugin_data", |
819 | 827 | /* translators: %s: Plugin name. */ |
820 | 828 | esc_attr( sprintf( _x( 'Delete %s', 'plugin' ), $plugin_data['Name'] ) ), |
821 | 829 | __( 'Delete' ) |