]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/plugin-editor.php
WordPress 4.0
[autoinstalls/wordpress.git] / wp-admin / plugin-editor.php
index 2167c1ac74d221d2b3f0192796738a3912c675c4..1c242955ba72318c0a8dab4ffbedc94cd0e01253 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 /** WordPress Administration Bootstrap */
-require_once('./admin.php');
+require_once( dirname( __FILE__ ) . '/admin.php' );
 
 if ( is_multisite() && ! is_network_admin() ) {
        wp_redirect( network_admin_url( 'plugin-editor.php' ) );
@@ -24,8 +24,17 @@ wp_reset_vars( array( 'action', 'error', 'file', 'plugin' ) );
 
 $plugins = get_plugins();
 
-if ( empty($plugins) )
-       wp_die( __('There are no plugins installed on this site.') );
+if ( empty( $plugins ) ) {
+       include( ABSPATH . 'wp-admin/admin-header.php' );
+       ?>
+       <div class="wrap">
+               <h2><?php echo esc_html( $title ); ?></h2>
+               <div id="message" class="error"><p><?php _e( 'You do not appear to have any plugins available at this time.' ); ?></p></div>
+       </div>
+       <?php
+       include( ABSPATH . 'wp-admin/admin-footer.php' );
+       exit;
+}
 
 if ( $file ) {
        $plugin = $file;
@@ -74,8 +83,6 @@ case 'update':
        }
        exit;
 
-break;
-
 default:
 
        if ( isset($_GET['liveupdate']) ) {
@@ -94,7 +101,15 @@ default:
 
        // List of allowable extensions
        $editable_extensions = array('php', 'txt', 'text', 'js', 'css', 'html', 'htm', 'xml', 'inc', 'include');
-       $editable_extensions = (array) apply_filters('editable_extensions', $editable_extensions);
+
+       /**
+        * Filter file type extensions editable in the plugin editor.
+        *
+        * @since 2.8.0
+        *
+        * @param array $editable_extensions An array of editable plugin file extensions.
+        */
+       $editable_extensions = (array) apply_filters( 'editable_extensions', $editable_extensions );
 
        if ( ! is_file($real_file) ) {
                wp_die(sprintf('<p>%s</p>', __('No such file exists! Double check the name and try again.')));
@@ -124,7 +139,7 @@ default:
                '<p><strong>' . __('For more information:') . '</strong></p>' .
                '<p>' . __('<a href="http://codex.wordpress.org/Plugins_Editor_Screen" target="_blank">Documentation on Editing Plugins</a>') . '</p>' .
                '<p>' . __('<a href="http://codex.wordpress.org/Writing_a_Plugin" target="_blank">Documentation on Writing Plugins</a>') . '</p>' .
-               '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
+               '<p>' . __('<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
        );
 
        require_once(ABSPATH . 'wp-admin/admin-header.php');
@@ -159,7 +174,6 @@ default:
 </div>
 <?php endif; ?>
 <div class="wrap">
-<?php screen_icon(); ?>
 <h2><?php echo esc_html( $title ); ?></h2>
 
 <div class="fileedit-sub">