X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/fa11948979fd6a4ea5705dc613b239699a459db3..refs/tags/wordpress-4.4:/wp-admin/plugin-editor.php diff --git a/wp-admin/plugin-editor.php b/wp-admin/plugin-editor.php index 94925b48..15581640 100644 --- a/wp-admin/plugin-editor.php +++ b/wp-admin/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' ); + ?> +
+

+

+
+ time() ) + (array) get_option( 'recently_activated' ) ); + } else { + update_site_option( 'recently_activated', array( $file => time() ) + (array) get_site_option( 'recently_activated' ) ); + } wp_redirect(add_query_arg('_wpnonce', wp_create_nonce('edit-plugin-test_' . $file), "plugin-editor.php?file=$file&liveupdate=1&scrollto=$scrollto&networkwide=" . $network_wide)); exit; @@ -74,8 +86,6 @@ case 'update': } exit; -break; - default: if ( isset($_GET['liveupdate']) ) { @@ -123,16 +133,16 @@ default: '

' . __('You can use the editor to make changes to any of your plugins’ individual PHP files. Be aware that if you make changes, plugins updates will overwrite your customizations.') . '

' . '

' . __('Choose a plugin to edit from the menu in the upper right and click the Select button. Click once on any file name to load it in the editor, and make your changes. Don’t forget to save your changes (Update File) when you’re finished.') . '

' . '

' . __('The Documentation menu below the editor lists the PHP functions recognized in the plugin file. Clicking Look Up takes you to a web page about that particular function.') . '

' . - '

' . __('In the editing area the Tab key enters a tab character. To move below this area by pressing Tab, press the Esc key followed by the Tab key.') . '

' . + '

' . __( 'In the editing area the Tab key enters a tab character. To move below this area by pressing Tab, press the Esc key followed by the Tab key. In some cases the Esc key will need to be pressed twice before the Tab key will allow you to continue.' ) . '

' . '

' . __('If you want to make changes but don’t want them to be overwritten when the plugin is updated, you may be ready to think about writing your own plugin. For information on how to edit plugins, write your own from scratch, or just better understand their anatomy, check out the links below.') . '

' . ( is_network_admin() ? '

' . __('Any edits to files from this screen will be reflected on all sites in the network.') . '

' : '' ) ) ); get_current_screen()->set_help_sidebar( '

' . __('For more information:') . '

' . - '

' . __('Documentation on Editing Plugins') . '

' . - '

' . __('Documentation on Writing Plugins') . '

' . - '

' . __('Support Forums') . '

' + '

' . __('Documentation on Editing Plugins') . '

' . + '

' . __('Documentation on Writing Plugins') . '

' . + '

' . __('Support Forums') . '

' ); require_once(ABSPATH . 'wp-admin/admin-header.php'); @@ -157,32 +167,43 @@ default: $content = esc_textarea( $content ); ?> -

+

fatal error.') ?>

- + if ( wp_verify_nonce( $_GET['_error_nonce'], 'plugin-activation-error_' . $file ) ) { + $iframe_url = add_query_arg( array( + 'action' => 'error_scrape', + 'plugin' => urlencode( $file ), + '_wpnonce' => urlencode( $_GET['_error_nonce'] ), + ), admin_url( 'plugins.php' ) ); + ?> +
- -

+

%s (active)'), $file); - else - echo sprintf(__('Browsing %s (active)'), $file); + if ( is_plugin_active( $plugin ) ) { + if ( is_writeable( $real_file ) ) { + /* translators: %s: plugin file name */ + echo sprintf( __( 'Editing %s (active)' ), '' . $file . '' ); + } else { + /* translators: %s: plugin file name */ + echo sprintf( __( 'Browsing %s (active)' ), '' . $file . '' ); + } } else { - if ( is_writeable($real_file) ) - echo sprintf(__('Editing %s (inactive)'), $file); - else - echo sprintf(__('Browsing %s (inactive)'), $file); + if ( is_writeable( $real_file ) ) { + /* translators: %s: plugin file name */ + echo sprintf( __( 'Editing %s (inactive)' ), '' . $file . '' ); + } else { + /* translators: %s: plugin file name */ + echo sprintf( __( 'Browsing %s (inactive)' ), '' . $file . '' ); + } } ?>
@@ -210,7 +231,7 @@ default:
-

+

-
+
@@ -256,7 +277,7 @@ foreach ( $plugin_files as $plugin_file ) : ?>

-

the Codex for more information.'); ?>

+

the Codex for more information.'); ?>