Turn hard-coded paths to defines. Pull gettext includes int wp-settings. Props mdawaffe. fixes #3157
git-svn-id: http://svn.automattic.com/wordpress/trunk@4202 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -1721,8 +1721,7 @@ function get_plugins() {
|
||||
}
|
||||
|
||||
$wp_plugins = array ();
|
||||
$plugin_loc = 'wp-content/plugins';
|
||||
$plugin_root = ABSPATH.$plugin_loc;
|
||||
$plugin_root = ABSPATH . PLUGINDIR;
|
||||
|
||||
// Files in wp-content/plugins directory
|
||||
$plugins_dir = @ dir($plugin_root);
|
||||
|
||||
@@ -52,7 +52,7 @@ if (isset($plugin_page)) {
|
||||
wp_die(__('Invalid plugin page'));
|
||||
}
|
||||
|
||||
if (! file_exists(ABSPATH . "wp-content/plugins/$plugin_page"))
|
||||
if (! file_exists(ABSPATH . PLUGINDIR . "/$plugin_page"))
|
||||
wp_die(sprintf(__('Cannot load %s.'), htmlentities($plugin_page)));
|
||||
|
||||
do_action('load-' . $plugin_page);
|
||||
@@ -60,7 +60,7 @@ if (isset($plugin_page)) {
|
||||
if (! isset($_GET['noheader']))
|
||||
require_once(ABSPATH . '/wp-admin/admin-header.php');
|
||||
|
||||
include(ABSPATH . "wp-content/plugins/$plugin_page");
|
||||
include(ABSPATH . PLUGINDIR . "/$plugin_page");
|
||||
}
|
||||
|
||||
include(ABSPATH . 'wp-admin/admin-footer.php');
|
||||
|
||||
@@ -12,7 +12,7 @@ foreach ($menu as $item) {
|
||||
if (( strcmp($self, $item[2]) == 0 && empty($parent_file)) || ($parent_file && ($item[2] == $parent_file))) $class = ' class="current"';
|
||||
|
||||
if ( !empty($submenu[$item[2]]) || current_user_can($item[1]) ) {
|
||||
if ( file_exists(ABSPATH . "wp-content/plugins/{$item[2]}") )
|
||||
if ( file_exists(ABSPATH . PLUGINDIR . "/{$item[2]}") )
|
||||
echo "\n\t<li><a href='" . get_option('siteurl') . "/wp-admin/admin.php?page={$item[2]}'$class>{$item[0]}</a></li>";
|
||||
else
|
||||
echo "\n\t<li><a href='" . get_option('siteurl') . "/wp-admin/{$item[2]}'$class>{$item[0]}</a></li>";
|
||||
@@ -40,7 +40,7 @@ else $class = '';
|
||||
|
||||
$menu_hook = get_plugin_page_hook($item[2], $parent_file);
|
||||
|
||||
if (file_exists(ABSPATH . "wp-content/plugins/{$item[2]}") || ! empty($menu_hook)) {
|
||||
if (file_exists(ABSPATH . PLUGINDIR . "/{$item[2]}") || ! empty($menu_hook)) {
|
||||
if ( 'admin.php' == $pagenow )
|
||||
echo "\n\t<li><a href='" . get_option('siteurl') . "/wp-admin/admin.php?page={$item[2]}'$class>{$item[0]}</a></li>";
|
||||
else
|
||||
@@ -58,4 +58,4 @@ endif;
|
||||
|
||||
do_action('admin_notices');
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -14,7 +14,7 @@ if (empty($file)) {
|
||||
}
|
||||
|
||||
$file = validate_file_to_edit($file, $plugin_files);
|
||||
$real_file = get_real_file_to_edit("wp-content/plugins/$file");
|
||||
$real_file = get_real_file_to_edit( PLUGINDIR . "/$file");
|
||||
|
||||
switch($action) {
|
||||
|
||||
@@ -46,7 +46,7 @@ default:
|
||||
|
||||
require_once('admin-header.php');
|
||||
|
||||
update_recently_edited("wp-content/plugins/$file");
|
||||
update_recently_edited(PLUGINDIR . "/$file");
|
||||
|
||||
if (!is_file($real_file))
|
||||
$error = 1;
|
||||
|
||||
@@ -9,7 +9,7 @@ if ( isset($_GET['action']) ) {
|
||||
$current[] = trim( $_GET['plugin'] );
|
||||
sort($current);
|
||||
update_option('active_plugins', $current);
|
||||
include(ABSPATH . 'wp-content/plugins/' . trim( $_GET['plugin'] ));
|
||||
include(ABSPATH . PLUGINDIR . '/' . trim( $_GET['plugin'] ));
|
||||
do_action('activate_' . trim( $_GET['plugin'] ));
|
||||
}
|
||||
wp_redirect('plugins.php?activate=true');
|
||||
@@ -42,7 +42,7 @@ if ( !is_array($check_plugins) ) {
|
||||
// If a plugin file does not exist, remove it from the list of active
|
||||
// plugins.
|
||||
foreach ($check_plugins as $check_plugin) {
|
||||
if (!file_exists(ABSPATH . 'wp-content/plugins/' . $check_plugin)) {
|
||||
if (!file_exists(ABSPATH . PLUGINDIR . '/' . $check_plugin)) {
|
||||
$current = get_option('active_plugins');
|
||||
$key = array_search($check_plugin, $current);
|
||||
if ( false !== $key && NULL !== $key ) {
|
||||
@@ -123,10 +123,10 @@ if (empty($plugins)) {
|
||||
}
|
||||
?>
|
||||
|
||||
<p><?php _e('If something goes wrong with a plugin and you can’t use WordPress, delete or rename that file in the <code>wp-content/plugins</code> directory and it will be automatically deactivated.'); ?></p>
|
||||
<p><?php _e(sprintf('If something goes wrong with a plugin and you can’t use WordPress, delete or rename that file in the <code>%s</code> directory and it will be automatically deactivated.', PLUGINDIR)); ?></p>
|
||||
|
||||
<h2><?php _e('Get More Plugins'); ?></h2>
|
||||
<p><?php _e('You can find additional plugins for your site in the <a href="http://wordpress.org/extend/plugins/">WordPress plugin directory</a>. To install a plugin you generally just need to upload the plugin file into your <code>wp-content/plugins</code> directory. Once a plugin is uploaded, you may activate it here.'); ?></p>
|
||||
<p><?php _e(sprintf('You can find additional plugins for your site in the <a href="http://wordpress.org/extend/plugins/">WordPress plugin directory</a>. To install a plugin you generally just need to upload the plugin file into your <code>%s</code> directory. Once a plugin is uploaded, you may activate it here.', PLUGINDIR)); ?></p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user