Make WordPress Core

Ticket #3157: 3157.diff

File 3157.diff, 7.2 KB (added by mdawaffe, 18 years ago)
  • wp-includes/l10n.php

     
    11<?php
    2 
    3 if ( defined('WPLANG') && '' != constant('WPLANG') ) {
    4         include_once(ABSPATH . 'wp-includes/streams.php');
    5         include_once(ABSPATH . 'wp-includes/gettext.php');
    6 }
    7 
    82function get_locale() {
    93        global $locale;
    104
     
    7569        global $l10n;
    7670
    7771        $locale = get_locale();
    78         $mofile = ABSPATH . "wp-includes/languages/$locale.mo";
     72        $mofile = ABSPATH . LANGDIR . "/$locale.mo";
    7973
    8074        load_textdomain('default', $mofile);
    8175}
    8276
    83 function load_plugin_textdomain($domain, $path = 'wp-content/plugins') {
     77function load_plugin_textdomain($domain, $path = false) {
    8478        $locale = get_locale();
     79        if ( false === $path )
     80                $path = PLUGINDIR;
    8581
    8682        $mofile = ABSPATH . "$path/$domain-$locale.mo";
    8783        load_textdomain($domain, $mofile);
     
    9490        load_textdomain($domain, $mofile);
    9591}
    9692
    97 ?>
    98  No newline at end of file
     93?>
  • wp-settings.php

     
    8181        require (ABSPATH . 'wp-content/advanced-cache.php');
    8282
    8383define('WPINC', 'wp-includes');
     84if ( !defined('LANGDIR') )
     85        define('LANGDIR', WPINC . '/languages');   // no leading slash, no trailing slash
     86if ( !defined('PLUGINDIR') )
     87        define('PLUGINDIR', 'wp-content/plugins'); // no leading slash, no trailing slash
    8488if ( file_exists(ABSPATH . 'wp-content/db.php') )
    8589        require (ABSPATH . 'wp-content/db.php');
    8690else
     
    119123require (ABSPATH . WPINC . '/functions.php');
    120124require (ABSPATH . WPINC . '/plugin.php');
    121125require (ABSPATH . WPINC . '/default-filters.php');
     126if ( defined('WPLANG') && '' != constant('WPLANG') ) {
     127        include_once(ABSPATH . WPINC . '/streams.php');
     128        include_once(ABSPATH . WPINC . '/gettext.php');
     129}
    122130require_once (ABSPATH . WPINC . '/l10n.php');
    123131
    124132if ( !is_blog_installed() && (!strstr($_SERVER['PHP_SELF'], 'install.php') && !defined('WP_INSTALLING')) ) {
  • wp-admin/menu-header.php

     
    1212        if (( strcmp($self, $item[2]) == 0 && empty($parent_file)) || ($parent_file && ($item[2] == $parent_file))) $class = ' class="current"';
    1313   
    1414        if ( !empty($submenu[$item[2]]) || current_user_can($item[1]) ) {
    15                 if ( file_exists(ABSPATH . "wp-content/plugins/{$item[2]}") )
     15                if ( file_exists(ABSPATH . PLUGINDIR . "/{$item[2]}") )
    1616                        echo "\n\t<li><a href='" . get_option('siteurl') . "/wp-admin/admin.php?page={$item[2]}'$class>{$item[0]}</a></li>";
    1717                else
    1818                        echo "\n\t<li><a href='" . get_option('siteurl') . "/wp-admin/{$item[2]}'$class>{$item[0]}</a></li>";
     
    4040
    4141$menu_hook = get_plugin_page_hook($item[2], $parent_file);
    4242
    43 if (file_exists(ABSPATH . "wp-content/plugins/{$item[2]}") || ! empty($menu_hook)) {
     43if (file_exists(ABSPATH . PLUGINDIR . "/{$item[2]}") || ! empty($menu_hook)) {
    4444        if ( 'admin.php' == $pagenow )
    4545                echo "\n\t<li><a href='" . get_option('siteurl') . "/wp-admin/admin.php?page={$item[2]}'$class>{$item[0]}</a></li>";
    4646        else
     
    5858
    5959do_action('admin_notices');
    6060
    61 ?>
    62  No newline at end of file
     61?>
  • wp-admin/admin.php

     
    5252                        wp_die(__('Invalid plugin page'));
    5353                }
    5454
    55                 if (! file_exists(ABSPATH . "wp-content/plugins/$plugin_page"))
     55                if (! file_exists(ABSPATH . PLUGINDIR . "/$plugin_page"))
    5656                        wp_die(sprintf(__('Cannot load %s.'), htmlentities($plugin_page)));
    5757
    5858                do_action('load-' . $plugin_page);
     
    6060                if (! isset($_GET['noheader']))
    6161                        require_once(ABSPATH . '/wp-admin/admin-header.php');
    6262
    63                 include(ABSPATH . "wp-content/plugins/$plugin_page");
     63                include(ABSPATH . PLUGINDIR . "/$plugin_page");
    6464        }
    6565
    6666        include(ABSPATH . 'wp-admin/admin-footer.php');
  • wp-admin/admin-functions.php

     
    17211721        }
    17221722
    17231723        $wp_plugins = array ();
    1724         $plugin_loc = 'wp-content/plugins';
    1725         $plugin_root = ABSPATH.$plugin_loc;
     1724        $plugin_root = ABSPATH . PLUGINDIR;
    17261725
    17271726        // Files in wp-content/plugins directory
    17281727        $plugins_dir = @ dir($plugin_root);
  • wp-admin/plugins.php

     
    99                        $current[] = trim( $_GET['plugin'] );
    1010                        sort($current);
    1111                        update_option('active_plugins', $current);
    12                         include(ABSPATH . 'wp-content/plugins/' . trim( $_GET['plugin'] ));
     12                        include(ABSPATH . PLUGINDIR . '/' . trim( $_GET['plugin'] ));
    1313                        do_action('activate_' . trim( $_GET['plugin'] ));
    1414                }
    1515                wp_redirect('plugins.php?activate=true');
     
    4242// If a plugin file does not exist, remove it from the list of active
    4343// plugins.
    4444foreach ($check_plugins as $check_plugin) {
    45         if (!file_exists(ABSPATH . 'wp-content/plugins/' . $check_plugin)) {
     45        if (!file_exists(ABSPATH . PLUGINDIR . '/' . $check_plugin)) {
    4646                        $current = get_option('active_plugins');
    4747                        $key = array_search($check_plugin, $current);
    4848                        if ( false !== $key && NULL !== $key ) {
     
    123123}
    124124?>
    125125
    126 <p><?php _e('If something goes wrong with a plugin and you can&#8217;t use WordPress, delete or rename that file in the <code>wp-content/plugins</code> directory and it will be automatically deactivated.'); ?></p>
     126<p><?php _e(sprintf('If something goes wrong with a plugin and you can&#8217;t use WordPress, delete or rename that file in the <code>%s</code> directory and it will be automatically deactivated.', PLUGINDIR)); ?></p>
    127127
    128128<h2><?php _e('Get More Plugins'); ?></h2>
    129 <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>
     129<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>
    130130
    131131</div>
    132132
  • wp-admin/plugin-editor.php

     
    1414}
    1515
    1616$file = validate_file_to_edit($file, $plugin_files);
    17 $real_file = get_real_file_to_edit("wp-content/plugins/$file");
     17$real_file = get_real_file_to_edit( PLUGINDIR . "/$file");
    1818
    1919switch($action) {
    2020
     
    4646
    4747        require_once('admin-header.php');
    4848
    49         update_recently_edited("wp-content/plugins/$file");
     49        update_recently_edited(PLUGINDIR . "/$file");
    5050
    5151        if (!is_file($real_file))
    5252                $error = 1;