Make WordPress Core

Changeset 4202


Ignore:
Timestamp:
09/21/2006 08:46:39 PM (18 years ago)
Author:
ryan
Message:

Turn hard-coded paths to defines. Pull gettext includes int wp-settings. Props mdawaffe. fixes #3157

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-functions.php

    r4186 r4202  
    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
  • trunk/wp-admin/admin.php

    r4183 r4202  
    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
     
    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
  • trunk/wp-admin/menu-header.php

    r4144 r4202  
    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
     
    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>";
  • trunk/wp-admin/plugin-editor.php

    r4111 r4202  
    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) {
     
    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))
  • trunk/wp-admin/plugins.php

    r4144 r4202  
    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        }
     
    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);
     
    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>
  • trunk/wp-includes/l10n.php

    r3870 r4202  
    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;
     
    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";
  • trunk/wp-settings.php

    r4174 r4202  
    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');
     
    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
Note: See TracChangeset for help on using the changeset viewer.