]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/plugins.php
WordPress 4.7
[autoinstalls/wordpress.git] / wp-admin / plugins.php
index 4530831bc824c1bd38c370d9419e735f03ccdc9a..ae5ea58c5057b5cf679892b86593b284bbd30f68 100644 (file)
@@ -10,7 +10,7 @@
 require_once( dirname( __FILE__ ) . '/admin.php' );
 
 if ( ! current_user_can('activate_plugins') )
-       wp_die( __( 'You do not have sufficient permissions to manage plugins for this site.' ) );
+       wp_die( __( 'Sorry, you are not allowed to manage plugins for this site.' ) );
 
 $wp_list_table = _get_list_table('WP_Plugins_List_Table');
 $pagenum = $wp_list_table->get_pagenum();
@@ -30,7 +30,7 @@ if ( $action ) {
        switch ( $action ) {
                case 'activate':
                        if ( ! current_user_can('activate_plugins') )
-                               wp_die(__('You do not have sufficient permissions to activate plugins for this site.'));
+                               wp_die(__('Sorry, you are not allowed to activate plugins for this site.'));
 
                        if ( is_multisite() && ! is_network_admin() && is_network_only_plugin( $plugin ) ) {
                                wp_redirect( self_admin_url("plugins.php?plugin_status=$status&paged=$page&s=$s") );
@@ -69,7 +69,7 @@ if ( $action ) {
 
                case 'activate-selected':
                        if ( ! current_user_can('activate_plugins') )
-                               wp_die(__('You do not have sufficient permissions to activate plugins for this site.'));
+                               wp_die(__('Sorry, you are not allowed to activate plugins for this site.'));
 
                        check_admin_referer('bulk-plugins');
 
@@ -147,7 +147,7 @@ if ( $action ) {
 
                case 'error_scrape':
                        if ( ! current_user_can('activate_plugins') )
-                               wp_die(__('You do not have sufficient permissions to activate plugins for this site.'));
+                               wp_die(__('Sorry, you are not allowed to activate plugins for this site.'));
 
                        check_admin_referer('plugin-activation-error_' . $plugin);
 
@@ -168,7 +168,7 @@ if ( $action ) {
 
                case 'deactivate':
                        if ( ! current_user_can('activate_plugins') )
-                               wp_die(__('You do not have sufficient permissions to deactivate plugins for this site.'));
+                               wp_die(__('Sorry, you are not allowed to deactivate plugins for this site.'));
 
                        check_admin_referer('deactivate-plugin_' . $plugin);
 
@@ -193,7 +193,7 @@ if ( $action ) {
 
                case 'deactivate-selected':
                        if ( ! current_user_can('activate_plugins') )
-                               wp_die(__('You do not have sufficient permissions to deactivate plugins for this site.'));
+                               wp_die(__('Sorry, you are not allowed to deactivate plugins for this site.'));
 
                        check_admin_referer('bulk-plugins');
 
@@ -228,7 +228,7 @@ if ( $action ) {
 
                case 'delete-selected':
                        if ( ! current_user_can('delete_plugins') ) {
-                               wp_die(__('You do not have sufficient permissions to delete plugins for this site.'));
+                               wp_die(__('Sorry, you are not allowed to delete plugins for this site.'));
                        }
 
                        check_admin_referer('bulk-plugins');
@@ -327,13 +327,13 @@ if ( $action ) {
                                                }
                                        ?>
                                        <?php wp_nonce_field('bulk-plugins') ?>
-                                       <?php submit_button( $data_to_delete ? __( 'Yes, delete these files and data' ) : __( 'Yes, delete these files' ), 'button', 'submit', false ); ?>
+                                       <?php submit_button( $data_to_delete ? __( 'Yes, delete these files and data' ) : __( 'Yes, delete these files' ), '', 'submit', false ); ?>
                                </form>
                                <?php
                                $referer = wp_get_referer();
                                ?>
                                <form method="post" action="<?php echo $referer ? esc_url( $referer ) : ''; ?>" style="display:inline;">
-                                       <?php submit_button( __( 'No, return me to the plugin list' ), 'button', 'submit', false ); ?>
+                                       <?php submit_button( __( 'No, return me to the plugin list' ), '', 'submit', false ); ?>
                                </form>
                        </div>
                                <?php
@@ -356,7 +356,21 @@ if ( $action ) {
                                update_site_option( 'recently_activated', array() );
                        }
                        break;
+
+               default:
+                       if ( isset( $_POST['checked'] ) ) {
+                               check_admin_referer('bulk-plugins');
+                               $plugins = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array();
+                               $sendback = wp_get_referer();
+
+                               /** This action is documented in wp-admin/edit-comments.php */
+                               $sendback = apply_filters( 'handle_bulk_actions-' . get_current_screen()->id, $sendback, $action, $plugins );
+                               wp_safe_redirect( $sendback );
+                               exit;
+                       }
+                       break;
        }
+
 }
 
 $wp_list_table->prepare_items();
@@ -371,12 +385,11 @@ get_current_screen()->add_help_tab( array(
 'title'                => __('Overview'),
 'content'      =>
        '<p>' . __('Plugins extend and expand the functionality of WordPress. Once a plugin is installed, you may activate it or deactivate it here.') . '</p>' .
+       '<p>' . __( 'The search for installed plugins will search for terms in their name, description, or author.' ) . ' <span id="live-search-desc" class="hide-if-no-js">' . __( 'The search results will be updated as you type.' ) . '</span></p>' .
        '<p>' . sprintf(
-               /* translators: 1: Plugin Browser/Installer URL, 2: WordPress Plugin Directory URL 3: local plugin directory */
-               __( 'You can find additional plugins for your site by using the <a href="%1$s">Plugin Browser/Installer</a> functionality or by browsing the <a href="%2$s" target="_blank">WordPress Plugin Directory</a> directly and installing new plugins manually. To manually install a plugin you generally just need to upload the plugin file into your %3$s directory. Once a plugin has been installed, you can activate it here.' ),
-               'plugin-install.php',
-               'https://wordpress.org/plugins/',
-               '<code>/wp-content/plugins</code>'
+               /* translators: %s: WordPress Plugin Directory URL */
+               __( 'If you would like to see more plugins to choose from, click on the &#8220;Add New&#8221; button and you will be able to browse or search for additional plugins from the <a href="%s">WordPress Plugin Directory</a>. Plugins in the WordPress Plugin Directory are designed and developed by third parties, and are compatible with the license WordPress uses. Oh, and they&#8217;re free!' ),
+               __( 'https://wordpress.org/plugins/' )
        ) . '</p>'
 ) );
 get_current_screen()->add_help_tab( array(
@@ -393,8 +406,8 @@ get_current_screen()->add_help_tab( array(
 
 get_current_screen()->set_help_sidebar(
        '<p><strong>' . __('For more information:') . '</strong></p>' .
-       '<p>' . __('<a href="https://codex.wordpress.org/Managing_Plugins#Plugin_Management" target="_blank">Documentation on Managing Plugins</a>') . '</p>' .
-       '<p>' . __('<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
+       '<p>' . __('<a href="https://codex.wordpress.org/Managing_Plugins#Plugin_Management">Documentation on Managing Plugins</a>') . '</p>' .
+       '<p>' . __('<a href="https://wordpress.org/support/">Support Forums</a>') . '</p>'
 );
 
 get_current_screen()->set_screen_reader_content( array(
@@ -509,7 +522,7 @@ do_action( 'pre_current_active_plugins', $plugins['all'] );
 
 <?php $wp_list_table->views(); ?>
 
-<form method="get">
+<form class="search-form search-plugins" method="get">
 <?php $wp_list_table->search_box( __( 'Search Installed Plugins' ), 'plugin' ); ?>
 </form>
 
@@ -521,9 +534,12 @@ do_action( 'pre_current_active_plugins', $plugins['all'] );
 <?php $wp_list_table->display(); ?>
 </form>
 
+       <span class="spinner"></span>
 </div>
 
 <?php
 wp_print_request_filesystem_credentials_modal();
+wp_print_admin_notice_templates();
+wp_print_update_row_templates();
 
 include(ABSPATH . 'wp-admin/admin-footer.php');