time()) + (array)get_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; } wp_redirect("plugin-editor.php?file=$file&a=te&scrollto=$scrollto"); } else { wp_redirect("plugin-editor.php?file=$file&scrollto=$scrollto"); } exit; break; default: if ( isset($_GET['liveupdate']) ) { check_admin_referer('edit-plugin-test_' . $file); $error = validate_plugin($file); if ( is_wp_error($error) ) wp_die( $error ); if ( ! is_plugin_active($file) ) activate_plugin($file, "plugin-editor.php?file=$file&phperror=1", ! empty( $_GET['networkwide'] ) ); // we'll override this later if the plugin can be included without fatal error wp_redirect("plugin-editor.php?file=$file&a=te&scrollto=$scrollto"); exit; } // 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); if ( ! is_file($real_file) ) { wp_die(sprintf('

%s

', __('No such file exists! Double check the name and try again.'))); } else { // Get the extension of the file if ( preg_match('/\.([^.]+)$/', $real_file, $matches) ) { $ext = strtolower($matches[1]); // If extension is not in the acceptable list, skip it if ( !in_array( $ext, $editable_extensions) ) wp_die(sprintf('

%s

', __('Files of this type are not editable.'))); } } add_contextual_help($current_screen, '

' . __('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 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 Lookup takes you to a web page about that particular function. ') . '

' . '

' . __('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 a plugin or start from scratch, check out the links below.') . '

' . '

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

' . '

' . sprintf(__('Documentation on Editing Plugins'), 'http://codex.wordpress.org/Plugins_Editor_SubPanel') . '

' . '

' . sprintf(__('Support Forums'), 'http://wordpress.org/support/') . '

' ); require_once('./admin-header.php'); update_recently_edited(WP_PLUGIN_DIR . '/' . $file); $content = file_get_contents( $real_file ); if ( '.php' == substr( $real_file, strrpos( $real_file, '.' ) ) ) { $functions = wp_doc_link_parse( $content ); if ( !empty($functions) ) { $docs_select = ''; } } $content = htmlspecialchars( $content ); ?>

fatal error.') ?>

%s (active)'), $file); else 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); } ?>

Warning: Making changes to active plugins is not recommended. If your changes cause a fatal error, the plugin will be automatically deactivated.'); ?>

"; else echo ""; ?>

the Codex for more information.'); ?>