X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/9e77185fafaf4e60e2b73821e0e4b9b1a11fb85f..53f4633144ed68c8b8fb5861f992b5489894a940:/wp-admin/plugins.php
diff --git a/wp-admin/plugins.php b/wp-admin/plugins.php
index 988cfa93..75f24917 100644
--- a/wp-admin/plugins.php
+++ b/wp-admin/plugins.php
@@ -23,6 +23,8 @@ $s = isset($_REQUEST['s']) ? urlencode($_REQUEST['s']) : '';
// Clean up request URI from temporary args for screen options/paging uri's to work as expected.
$_SERVER['REQUEST_URI'] = remove_query_arg(array('error', 'deleted', 'activate', 'activate-multi', 'deactivate', 'deactivate-multi', '_error_nonce'), $_SERVER['REQUEST_URI']);
+wp_enqueue_script( 'updates' );
+
if ( $action ) {
switch ( $action ) {
@@ -120,7 +122,7 @@ if ( $action ) {
require_once(ABSPATH . 'wp-admin/admin-header.php');
echo '
';
- echo '
' . esc_html( $title ) . '
';
+ echo '
' . esc_html( $title ) . '
';
$url = self_admin_url('update.php?action=update-selected&plugins=' . urlencode( join(',', $plugins) ));
$url = wp_nonce_url($url, 'bulk-update-plugins');
@@ -146,12 +148,15 @@ if ( $action ) {
@ini_set('display_errors', true); //Ensure that Fatal errors are displayed.
// Go back to "sandbox" scope so we get the same errors as before
+ /**
+ * @param string $plugin
+ */
function plugin_sandbox_scrape( $plugin ) {
wp_register_plugin_realpath( WP_PLUGIN_DIR . '/' . $plugin );
include( WP_PLUGIN_DIR . '/' . $plugin );
}
plugin_sandbox_scrape( $plugin );
- /** This action is documented in wp-admin/includes/plugins.php */
+ /** This action is documented in wp-admin/includes/plugin.php */
do_action( "activate_{$plugin}" );
exit;
@@ -207,8 +212,9 @@ if ( $action ) {
exit;
case 'delete-selected':
- if ( ! current_user_can('delete_plugins') )
+ if ( ! current_user_can('delete_plugins') ) {
wp_die(__('You do not have sufficient permissions to delete plugins for this site.'));
+ }
check_admin_referer('bulk-plugins');
@@ -237,39 +243,63 @@ if ( $action ) {
$data ) {
$plugin_info[ $plugin_file ] = _get_plugin_data_markup_translate( $plugin_file, $data );
$plugin_info[ $plugin_file ]['is_uninstallable'] = is_uninstallable_plugin( $plugin );
- if ( ! $plugin_info[ $plugin_file ]['Network'] )
+ if ( ! $plugin_info[ $plugin_file ]['Network'] ) {
$have_non_network_plugins = true;
+ }
+ }
+ }
+
+ // Add translation files.
+ if ( ! empty( $plugin_translations[ $plugin_slug ] ) ) {
+ $translations = $plugin_translations[ $plugin_slug ];
+
+ foreach ( $translations as $translation => $data ) {
+ $files_to_delete[] = $plugin_slug . '-' . $translation . '.po';
+ $files_to_delete[] = $plugin_slug . '-' . $translation . '.mo';
}
}
}
}
$plugins_to_delete = count( $plugin_info );
- echo '
' . _n( 'Delete Plugin', 'Delete Plugins', $plugins_to_delete ) . '
';
?>
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
';
+ foreach ( (array) $plugins as $plugin ) {
+ echo '';
+ }
?>
-
+
-
' . esc_html(str_replace(WP_PLUGIN_DIR, '', $file)) . '';
+ foreach ( (array) $files_to_delete as $file ) {
+ echo '- ' . esc_html( str_replace( WP_PLUGIN_DIR, '', $file ) ) . '
';
+ }
?>
@@ -337,7 +372,7 @@ $wp_list_table->prepare_items();
wp_enqueue_script('plugin-install');
add_thickbox();
-add_screen_option( 'per_page', array('label' => _x( 'Plugins', 'plugins per page (screen options)' ), 'default' => 999 ) );
+add_screen_option( 'per_page', array( 'default' => 999 ) );
get_current_screen()->add_help_tab( array(
'id' => 'overview',
@@ -356,7 +391,7 @@ get_current_screen()->add_help_tab( array(
get_current_screen()->set_help_sidebar(
'
' . __('For more information:') . '
' .
- '
' . __('Documentation on Managing Plugins') . '
' .
+ '
' . __('Documentation on Managing Plugins') . '
' .
'
' . __('Support Forums') . '
'
);
@@ -394,30 +429,30 @@ if ( !empty($invalid) )
delete_transient( 'plugins_delete_result_' . $user_ID );
if ( is_wp_error($delete_result) ) : ?>
-
get_error_message() ); ?>
+
get_error_message() ); ?>
-
+
-
+
-
+
-
+
-
+
-
+
-
-
+
' . __('Search results for “%s”') . '', esc_html( $s ) ); ?>
-
+
views(); ?>
-
-