Changeset 7999
- Timestamp:
- 05/27/2008 05:55:24 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin.php
r7998 r7999 59 59 } 60 60 61 if (! ( file_exists( ABSPATH . PLUGINDIR . "/$plugin_page") && is_file( ABSPATH . PLUGINDIR . "/$plugin_page") ) )61 if (! ( file_exists(WP_PLUGIN_DIR . "/$plugin_page") && is_file(WP_PLUGIN_DIR . "/$plugin_page") ) ) 62 62 wp_die(sprintf(__('Cannot load %s.'), htmlentities($plugin_page))); 63 63 … … 67 67 require_once(ABSPATH . 'wp-admin/admin-header.php'); 68 68 69 include( ABSPATH . PLUGINDIR . "/$plugin_page");69 include(WP_PLUGIN_DIR . "/$plugin_page"); 70 70 } 71 71 -
trunk/wp-admin/import/mt.php
r7883 r7999 180 180 function select_authors() { 181 181 if ( $_POST['upload_type'] === 'ftp' ) { 182 $file['file'] = ABSPATH . 'wp-content/mt-export.txt';182 $file['file'] = WP_CONTENT_DIR . '/mt-export.txt'; 183 183 if ( !file_exists($file['file']) ) 184 184 $file['error'] = __('<code>mt-export.txt</code> does not exist'); … … 427 427 $this->id = (int) $_GET['id']; 428 428 if ( $this->id == 0 ) 429 $this->file = ABSPATH . 'wp-content/mt-export.txt';429 $this->file = WP_CONTENT_DIR . '/mt-export.txt'; 430 430 else 431 431 $this->file = get_attached_file($this->id); -
trunk/wp-admin/includes/class-wp-filesystem-direct.php
r7785 r7999 14 14 $this->permission = $perm; 15 15 } 16 function find_base_dir($base = '.', $echo = false){ 17 return str_replace('\\','/',ABSPATH); 18 } 19 function get_base_dir($base = '.', $echo = false){ 16 function find_base_dir($path = false, $base = '.', $echo = false){ 17 if (!$path) 18 $path = ABSPATH; 19 return str_replace('\\','/',$path); 20 } 21 function get_base_dir($path = false, $base = '.', $echo = false){ 20 22 return $this->find_base_dir($base, $echo); 21 23 } -
trunk/wp-admin/includes/class-wp-filesystem-ftpext.php
r7443 r7999 85 85 } 86 86 87 function find_base_dir($base = '.',$echo = false, $loop = false) { 87 function find_base_dir($path = false, $base = '.',$echo = false, $loop = false) { 88 if (!$path) 89 $path = ABSPATH; 90 88 91 //Sanitize the Windows path formats, This allows easier conparison and aligns it to FTP output. 89 $ abspath = str_replace('\\','/',ABSPATH); //windows: Straighten up the paths..90 if( strpos($ abspath, ':') ){ //Windows, Strip out the driveletter91 if( preg_match("|.{1}\:(.+)|i", $ abspath, $mat) )92 $ abspath = $mat[1];92 $path = str_replace('\\','/',$path); //windows: Straighten up the paths.. 93 if( strpos($path, ':') ){ //Windows, Strip out the driveletter 94 if( preg_match("|.{1}\:(.+)|i", $path, $mat) ) 95 $path = $mat[1]; 93 96 } 94 97 … … 98 101 99 102 //Can we see the Current directory as part of the ABSPATH? 100 $location = strpos($ abspath, $base);103 $location = strpos($path, $base); 101 104 if( false !== $location ) { 102 $newbase = path_join($base, substr($ abspath, $location + strlen($base)));105 $newbase = path_join($base, substr($path, $location + strlen($base))); 103 106 104 107 if( false !== $this->chdir($newbase) ){ //chdir sometimes returns null under certain circumstances, even when its changed correctly, FALSE will be returned if it doesnt change correctly. … … 117 120 $files = $this->dirlist($base); 118 121 119 $arrPath = explode('/', $ abspath);122 $arrPath = explode('/', $path); 120 123 foreach($arrPath as $key){ 121 124 //Working from /home/ to /user/ to /wordpress/ see if that file exists within the current folder, … … 127 130 $folder = path_join($base, $key); 128 131 if($echo) printf( __('Changing to %s') . '<br/>', $folder ); 129 $ret = $this->find_base_dir( $ folder, $echo, $loop);132 $ret = $this->find_base_dir( $path, $folder, $echo, $loop); 130 133 if( $ret ) 131 134 return $ret; … … 140 143 return false;//Prevent tihs function looping again. 141 144 //As an extra last resort, Change back to / if the folder wasnt found. This comes into effect when the CWD is /home/user/ but WP is at /var/www/.... mainly dedicated setups. 142 return $this->find_base_dir( '/', $echo, true);143 } 144 145 function get_base_dir($ base = '.', $echo = false){145 return $this->find_base_dir($path, '/', $echo, true); 146 } 147 148 function get_base_dir($path = false, $base = '.', $echo = false){ 146 149 if( defined('FTP_BASE') ) 147 150 $this->wp_base = FTP_BASE; 148 151 if( empty($this->wp_base) ) 149 $this->wp_base = $this->find_base_dir($ base,$echo);152 $this->wp_base = $this->find_base_dir($path, $base, $echo); 150 153 return $this->wp_base; 151 154 } -
trunk/wp-admin/includes/class-wp-filesystem-ftpsockets.php
r7443 r7999 87 87 } 88 88 89 function find_base_dir($base = '.',$echo = false, $loop = false) { 89 function find_base_dir($path = false, $base = '.',$echo = false, $loop = false) { 90 if (!$path) 91 $path = ABSPATH; 92 90 93 //Sanitize the Windows path formats, This allows easier conparison and aligns it to FTP output. 91 $ abspath = str_replace('\\','/',ABSPATH); //windows: Straighten up the paths..92 if( strpos($ abspath, ':') ){ //Windows, Strip out the driveletter93 if( preg_match("|.{1}\:(.+)|i", $ abspath, $mat) )94 $ abspath = $mat[1];94 $path = str_replace('\\','/',$path); //windows: Straighten up the paths.. 95 if( strpos($path, ':') ){ //Windows, Strip out the driveletter 96 if( preg_match("|.{1}\:(.+)|i", $path, $mat) ) 97 $path = $mat[1]; 95 98 } 96 99 … … 100 103 101 104 //Can we see the Current directory as part of the ABSPATH? 102 $location = strpos($ abspath, $base);105 $location = strpos($path, $base); 103 106 if( false !== $location ) { 104 $newbase = path_join($base, substr($ abspath, $location + strlen($base)));107 $newbase = path_join($base, substr($path, $location + strlen($base))); 105 108 106 109 if( false !== $this->chdir($newbase) ){ //chdir sometimes returns null under certain circumstances, even when its changed correctly, FALSE will be returned if it doesnt change correctly. … … 119 122 $files = $this->dirlist($base); 120 123 121 $arrPath = explode('/', $ abspath);124 $arrPath = explode('/', $path); 122 125 foreach($arrPath as $key){ 123 126 //Working from /home/ to /user/ to /wordpress/ see if that file exists within the current folder, … … 129 132 $folder = path_join($base, $key); 130 133 if($echo) printf( __('Changing to %s') . '<br/>', $folder ); 131 $ret = $this->find_base_dir( $folder, $echo, $loop);134 $ret = $this->find_base_dir($path, $folder, $echo, $loop); 132 135 if( $ret ) 133 136 return $ret; … … 142 145 return false;//Prevent tihs function looping again. 143 146 //As an extra last resort, Change back to / if the folder wasnt found. This comes into effect when the CWD is /home/user/ but WP is at /var/www/.... mainly dedicated setups. 144 return $this->find_base_dir( '/', $echo, true);145 } 146 147 function get_base_dir($ base = '.', $echo = false){147 return $this->find_base_dir($path, '/', $echo, true); 148 } 149 150 function get_base_dir($path = false, $base = '.', $echo = false){ 148 151 if( defined('FTP_BASE') ) 149 152 $this->wp_base = FTP_BASE; 150 153 if( empty($this->wp_base) ) 151 $this->wp_base = $this->find_base_dir($ base, $echo);154 $this->wp_base = $this->find_base_dir($path, $base, $echo); 152 155 return $this->wp_base; 153 156 } -
trunk/wp-admin/includes/file.php
r7921 r7999 47 47 return trailingslashit(WP_TEMP_DIR); 48 48 49 $temp = ABSPATH . 'wp-content/';49 $temp = WP_CONTENT_DIR . '/'; 50 50 if ( is_dir($temp) && is_writable($temp) ) 51 51 return $temp; -
trunk/wp-admin/includes/plugin.php
r7488 r7999 40 40 41 41 $wp_plugins = array (); 42 $plugin_root = ABSPATH . PLUGINDIR;42 $plugin_root = WP_PLUGIN_DIR; 43 43 if( !empty($plugin_folder) ) 44 44 $plugin_root .= $plugin_folder; … … 105 105 wp_redirect(add_query_arg('_error_nonce', wp_create_nonce('plugin-activation-error_' . $plugin), $redirect)); // we'll override this later if the plugin can be included without fatal error 106 106 ob_start(); 107 @include( ABSPATH . PLUGINDIR . '/' . $plugin);107 @include(WP_PLUGIN_DIR . '/' . $plugin); 108 108 $current[] = $plugin; 109 109 sort($current); … … 180 180 // plugins. 181 181 foreach ( $check_plugins as $check_plugin ) { 182 if ( !file_exists( ABSPATH . PLUGINDIR . '/' . $check_plugin) ) {182 if ( !file_exists(WP_PLUGIN_DIR . '/' . $check_plugin) ) { 183 183 $current = get_option('active_plugins'); 184 184 $key = array_search($check_plugin, $current); … … 194 194 if ( validate_file($plugin) ) 195 195 return new WP_Error('plugin_invalid', __('Invalid plugin.')); 196 if ( ! file_exists( ABSPATH . PLUGINDIR . '/' . $plugin) )196 if ( ! file_exists(WP_PLUGIN_DIR . '/' . $plugin) ) 197 197 return new WP_Error('plugin_not_found', __('Plugin file does not exist.')); 198 198 -
trunk/wp-admin/includes/schema.php
r7886 r7999 227 227 // Safe mode screws up mkdir(), so we must use a flat structure. 228 228 add_option('uploads_use_yearmonth_folders', 0); 229 add_option('upload_path', 'wp-content');229 add_option('upload_path', WP_CONTENT_DIR); 230 230 } else { 231 231 add_option('uploads_use_yearmonth_folders', 1); 232 add_option('upload_path', 'wp-content/uploads');232 add_option('upload_path', WP_CONTENT_DIR . '/uploads'); 233 233 } 234 234 -
trunk/wp-admin/includes/update.php
r7547 r7999 160 160 return new WP_Error('fs_error', __('Filesystem error'), $wp_filesystem->errors); 161 161 162 //Get the Basefolder163 $base = $wp_filesystem->get_base_dir( );162 //Get the base plugin folder 163 $base = $wp_filesystem->get_base_dir(WP_PLUGIN_DIR); 164 164 165 165 if ( empty($base) ) … … 180 180 return new WP_Error('download_failed', __('Download failed.'), $file->get_error_message()); 181 181 182 $working_dir = $ base . 'wp-content/upgrade/' . basename($plugin, '.php');182 $working_dir = $wp_filesystem->get_base_dir(WP_CONTENT_DIR) . '/upgrade/' . basename($plugin, '.php'); 183 183 184 184 // Clean up working directory … … 206 206 // Remove the existing plugin. 207 207 apply_filters('update_feedback', __('Removing the old version of the plugin')); 208 $plugin_dir = dirname($base . PLUGINDIR ."/$plugin");208 $plugin_dir = dirname($base . "/$plugin"); 209 209 $plugin_dir = trailingslashit($plugin_dir); 210 210 211 211 // If plugin is in its own directory, recursively delete the directory. 212 if ( strpos($plugin, '/') && $plugin_dir != $base . PLUGINDIR .'/' ) //base check on if plugin includes directory seperator AND that its not the root plugin folder212 if ( strpos($plugin, '/') && $plugin_dir != $base . '/' ) //base check on if plugin includes directory seperator AND that its not the root plugin folder 213 213 $deleted = $wp_filesystem->delete($plugin_dir, true); 214 214 else 215 $deleted = $wp_filesystem->delete($base . PLUGINDIR . "/$plugin");215 $deleted = $wp_filesystem->delete($base . '/' . $plugin); 216 216 217 217 if ( !$deleted ) { … … 222 222 apply_filters('update_feedback', __('Installing the latest version')); 223 223 // Copy new version of plugin into place. 224 if ( !copy_dir($working_dir, $base . PLUGINDIR) ) {224 if ( !copy_dir($working_dir, $base) ) { 225 225 //$wp_filesystem->delete($working_dir, true); //TODO: Uncomment? This DOES mean that the new files are available in the upgrade folder if it fails. 226 226 return new WP_Error('install_failed', __('Installation failed')); -
trunk/wp-admin/includes/upgrade.php
r7936 r7999 1 1 <?php 2 2 3 if ( file_exists( ABSPATH . 'wp-content/install.php') )4 require ( ABSPATH . 'wp-content/install.php');3 if ( file_exists(WP_CONTENT_DIR . '/install.php') ) 4 require (WP_CONTENT_DIR . '/install.php'); 5 5 require_once(ABSPATH . 'wp-admin/includes/admin.php'); 6 6 require_once(ABSPATH . 'wp-admin/includes/schema.php'); … … 1087 1087 function make_site_theme_from_oldschool($theme_name, $template) { 1088 1088 $home_path = get_home_path(); 1089 $site_dir = ABSPATH . "wp-content/themes/$template";1089 $site_dir = WP_CONTENT_DIR . "/themes/$template"; 1090 1090 1091 1091 if (! file_exists("$home_path/index.php")) … … 1106 1106 $index = implode('', file("$oldpath/$oldfile")); 1107 1107 if (strpos($index, 'WP_USE_THEMES') !== false) { 1108 if (! @copy( ABSPATH . 'wp-content/themes/default/index.php', "$site_dir/$newfile"))1108 if (! @copy(WP_CONTENT_DIR . '/themes/default/index.php', "$site_dir/$newfile")) 1109 1109 return false; 1110 1110 continue; // Don't copy anything … … 1154 1154 1155 1155 function make_site_theme_from_default($theme_name, $template) { 1156 $site_dir = ABSPATH . "wp-content/themes/$template";1157 $default_dir = ABSPATH . 'wp-content/themes/default';1156 $site_dir = WP_CONTENT_DIR . "/themes/$template"; 1157 $default_dir = WP_CONTENT_DIR . '/themes/default'; 1158 1158 1159 1159 // Copy files from the default theme to the site theme. … … 1212 1212 $theme_name = __get_option('blogname'); 1213 1213 $template = sanitize_title($theme_name); 1214 $site_dir = ABSPATH . "wp-content/themes/$template";1214 $site_dir = WP_CONTENT_DIR . "/themes/$template"; 1215 1215 1216 1216 // If the theme already exists, nothing to do. … … 1220 1220 1221 1221 // We must be able to write to the themes dir. 1222 if (! is_writable( ABSPATH . "wp-content/themes")) {1222 if (! is_writable(WP_CONTENT_DIR . "/themes")) { 1223 1223 return false; 1224 1224 } -
trunk/wp-admin/menu-header.php
r7183 r7999 20 20 $submenu[$item[2]] = array_values($submenu[$item[2]]); // Re-index. 21 21 $menu_hook = get_plugin_page_hook($submenu[$item[2]][0][2], $item[2]); 22 if ( file_exists( ABSPATH . PLUGINDIR . "/{$submenu[$item[2]][0][2]}") || !empty($menu_hook))22 if ( file_exists(WP_PLUGIN_DIR . "/{$submenu[$item[2]][0][2]}") || !empty($menu_hook)) 23 23 echo "\n\t<li><a href='admin.php?page={$submenu[$item[2]][0][2]}'$class>{$item[0]}</a></li>"; 24 24 else … … 26 26 } else if ( current_user_can($item[1]) ) { 27 27 $menu_hook = get_plugin_page_hook($item[2], 'admin.php'); 28 if ( file_exists( ABSPATH . PLUGINDIR . "/{$item[2]}") || !empty($menu_hook) )28 if ( file_exists(WP_PLUGIN_DIR . "/{$item[2]}") || !empty($menu_hook) ) 29 29 echo "\n\t<li><a href='admin.php?page={$item[2]}'$class>{$item[0]}</a></li>"; 30 30 else … … 50 50 $submenu[$item[2]] = array_values($submenu[$item[2]]); // Re-index. 51 51 $menu_hook = get_plugin_page_hook($submenu[$item[2]][0][2], $item[2]); 52 if ( file_exists( ABSPATH . PLUGINDIR . "/{$submenu[$item[2]][0][2]}") || !empty($menu_hook))52 if ( file_exists(WP_PLUGIN_DIR . "/{$submenu[$item[2]][0][2]}") || !empty($menu_hook)) 53 53 echo "\n\t<li><a href='admin.php?page={$submenu[$item[2]][0][2]}'$class>{$item[0]}</a></li>"; 54 54 else … … 56 56 } else if ( current_user_can($item[1]) ) { 57 57 $menu_hook = get_plugin_page_hook($item[2], 'admin.php'); 58 if ( file_exists( ABSPATH . PLUGINDIR . "/{$item[2]}") || !empty($menu_hook) )58 if ( file_exists(WP_PLUGIN_DIR . "/{$item[2]}") || !empty($menu_hook) ) 59 59 echo "\n\t<li><a href='admin.php?page={$item[2]}'$class>{$item[0]}</a></li>"; 60 60 else … … 75 75 $submenu[$item[2]] = array_values($submenu[$item[2]]); // Re-index. 76 76 $menu_hook = get_plugin_page_hook($submenu[$item[2]][0][2], $item[2]); 77 if ( file_exists( ABSPATH . PLUGINDIR . "/{$submenu[$item[2]][0][2]}") || !empty($menu_hook))77 if ( file_exists(WP_PLUGIN_DIR . "/{$submenu[$item[2]][0][2]}") || !empty($menu_hook)) 78 78 echo "\n\t<li><a href='admin.php?page={$submenu[$item[2]][0][2]}'$class>{$item[0]}</a></li>"; 79 79 else … … 81 81 } else if ( current_user_can($item[1]) ) { 82 82 $menu_hook = get_plugin_page_hook($item[2], 'admin.php'); 83 if ( file_exists( ABSPATH . PLUGINDIR . "/{$item[2]}") || !empty($menu_hook) )83 if ( file_exists(WP_PLUGIN_DIR . "/{$item[2]}") || !empty($menu_hook) ) 84 84 echo "\n\t<li><a href='admin.php?page={$item[2]}'$class>{$item[0]}</a></li>"; 85 85 else … … 107 107 $submenu[$item[2]] = array_values($submenu[$item[2]]); // Re-index. 108 108 $menu_hook = get_plugin_page_hook($submenu[$item[2]][0][2], $item[2]); 109 if ( file_exists( ABSPATH . PLUGINDIR . "/{$submenu[$item[2]][0][2]}") || !empty($menu_hook))109 if ( file_exists(WP_PLUGIN_DIR . "/{$submenu[$item[2]][0][2]}") || !empty($menu_hook)) 110 110 $side_items[] = "\n\t<li><a href='admin.php?page={$submenu[$item[2]][0][2]}'$class>{$item[0]}</a>"; 111 111 else … … 113 113 } else if ( current_user_can($item[1]) ) { 114 114 $menu_hook = get_plugin_page_hook($item[2], 'admin.php'); 115 if ( file_exists( ABSPATH . PLUGINDIR . "/{$item[2]}") || !empty($menu_hook) )115 if ( file_exists(WP_PLUGIN_DIR . "/{$item[2]}") || !empty($menu_hook) ) 116 116 $side_items[] = "\n\t<li><a href='admin.php?page={$item[2]}'$class>{$item[0]}</a>"; 117 117 else … … 144 144 $menu_hook = get_plugin_page_hook($item[2], $parent_file); 145 145 146 if (file_exists( ABSPATH . PLUGINDIR . "/{$item[2]}") || ! empty($menu_hook)) {146 if (file_exists(WP_PLUGIN_DIR . "/{$item[2]}") || ! empty($menu_hook)) { 147 147 if ( 'admin.php' == $pagenow ) 148 148 echo "\n\t<li><a href='admin.php?page={$item[2]}'$class>{$item[0]}</a></li>"; -
trunk/wp-admin/plugin-editor.php
r7979 r7999 16 16 17 17 $file = validate_file_to_edit($file, $plugin_files); 18 $real_file = get_real_file_to_edit( PLUGINDIR . "/$file");18 $real_file = WP_PLUGIN_DIR . '/' . $file; 19 19 20 20 switch($action) { … … 69 69 require_once('admin-header.php'); 70 70 71 update_recently_edited( PLUGINDIR . "/$file");71 update_recently_edited(WP_PLUGIN_DIR . '/' . $file); 72 72 73 73 if ( ! is_file($real_file) ) -
trunk/wp-admin/plugins.php
r7846 r7999 19 19 error_reporting( E_ALL ^ E_NOTICE ); 20 20 @ini_set('display_errors', true); //Ensure that Fatal errors are displayed. 21 include( ABSPATH . PLUGINDIR . '/' . $plugin);21 include(WP_PLUGIN_DIR . '/' . $plugin); 22 22 } elseif ( 'deactivate' == $_GET['action'] ) { 23 23 check_admin_referer('deactivate-plugin_' . $_GET['plugin']); … … 124 124 $action_links[] = "<a href='" . wp_nonce_url("plugins.php?action=activate&plugin=$plugin_file", 'activate-plugin_' . $plugin_file) . "' title='".__('Activate this plugin')."' class='edit'>".__('Activate')."</a>"; 125 125 } 126 if ( current_user_can('edit_plugins') && is_writable( ABSPATH . PLUGINDIR . '/' . $plugin_file) )126 if ( current_user_can('edit_plugins') && is_writable(WP_PLUGIN_DIR . '/' . $plugin_file) ) 127 127 $action_links[] = "<a href='plugin-editor.php?file=$plugin_file' title='".__('Open this file in the Plugin Editor')."' class='edit'>".__('Edit')."</a>"; 128 128 … … 167 167 ?> 168 168 169 <p><?php printf(__('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>169 <p><?php printf(__('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.'), WP_PLUGIN_DIR); ?></p> 170 170 171 171 <h2><?php _e('Get More Plugins'); ?></h2> 172 172 <p><?php _e('You can find additional plugins for your site in the <a href="http://wordpress.org/extend/plugins/">WordPress plugin directory</a>.'); ?></p> 173 <p><?php printf(__('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>173 <p><?php printf(__('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.'), WP_PLUGIN_DIR); ?></p> 174 174 175 175 </div> -
trunk/wp-admin/update.php
r7979 r7999 118 118 show_message($result); 119 119 } else { 120 //Result is the new plugin file relative to PLUGINDIR120 //Result is the new plugin file relative to WP_PLUGIN_DIR 121 121 show_message(__('Plugin upgraded successfully')); 122 122 if( $result && $was_activated ){ … … 165 165 error_reporting( E_ALL ^ E_NOTICE ); 166 166 @ini_set('display_errors', true); //Ensure that Fatal errors are displayed. 167 include( ABSPATH . PLUGINDIR . '/' . $plugin);167 include(WP_PLUGIN_DIR . '/' . $plugin); 168 168 } 169 169 echo "</body></html>"; -
trunk/wp-includes/comment-template.php
r7910 r7999 666 666 require( $include ); 667 667 else 668 require( ABSPATH . 'wp-content/themes/default/comments.php');668 require( WP_CONTENT_DIR . '/themes/default/comments.php'); 669 669 } 670 670 -
trunk/wp-includes/functions.php
r7998 r7999 1081 1081 $upload_path = get_option( 'upload_path' ); 1082 1082 if ( trim($upload_path) === '' ) 1083 $upload_path = 'wp-content/uploads';1083 $upload_path = WP_CONTENT_DIR . '/uploads'; 1084 1084 $dir = $upload_path; 1085 1085 … … 1559 1559 function require_wp_db() { 1560 1560 global $wpdb; 1561 if ( file_exists( ABSPATH . 'wp-content/db.php' ) )1562 require_once( ABSPATH . 'wp-content/db.php' );1561 if ( file_exists( WP_CONTENT_DIR . '/db.php' ) ) 1562 require_once( WP_CONTENT_DIR . '/db.php' ); 1563 1563 else 1564 1564 require_once( ABSPATH . WPINC . '/wp-db.php' ); … … 1569 1569 1570 1570 // Load custom DB error template, if present. 1571 if ( file_exists( ABSPATH . 'wp-content/db-error.php' ) ) {1572 require_once( ABSPATH . 'wp-content/db-error.php' );1571 if ( file_exists( WP_CONTENT_DIR . '/db-error.php' ) ) { 1572 require_once( WP_CONTENT_DIR . '/db-error.php' ); 1573 1573 die(); 1574 1574 } -
trunk/wp-includes/general-template.php
r7998 r7999 8 8 load_template( TEMPLATEPATH . '/header.php'); 9 9 else 10 load_template( ABSPATH . 'wp-content/themes/default/header.php');10 load_template( WP_CONTENT_DIR . '/themes/default/header.php'); 11 11 } 12 12 … … 17 17 load_template( TEMPLATEPATH . '/footer.php'); 18 18 else 19 load_template( ABSPATH . 'wp-content/themes/default/footer.php');19 load_template( WP_CONTENT_DIR . '/themes/default/footer.php'); 20 20 } 21 21 … … 28 28 load_template( TEMPLATEPATH . '/sidebar.php'); 29 29 else 30 load_template( ABSPATH . 'wp-content/themes/default/sidebar.php');30 load_template( WP_CONTENT_DIR . '/themes/default/sidebar.php'); 31 31 } 32 32 -
trunk/wp-includes/js/tinymce/tiny_mce_config.php
r7971 r7999 207 207 208 208 // Cache path, this is where the .gz files will be stored 209 $cache_path = ABSPATH . 'wp-content/uploads/js_cache';209 $cache_path = WP_CONTENT_DIR . '/uploads/js_cache'; 210 210 if ( $disk_cache && ! is_dir($cache_path) ) 211 211 $disk_cache = wp_mkdir_p($cache_path); -
trunk/wp-includes/l10n.php
r7885 r7999 279 279 * The plugin may place all of the .mo files in another folder and set 280 280 * the $path based on the relative location from ABSPATH constant. The 281 * plugin may use the constant PLUGINDIR and/or plugin_basename() to281 * plugin may use the constant WP_PLUGIN_DIR and/or plugin_basename() to 282 282 * get path of the plugin and then add the folder which holds the .mo 283 283 * files. … … 292 292 293 293 if ( false === $path ) 294 $path = PLUGINDIR;295 296 $mofile = ABSPATH . "$path/$domain-$locale.mo";294 $path = WP_PLUGIN_DIR; 295 296 $mofile = $path . '/'. $domain . '-' . $locale . '.mo'; 297 297 load_textdomain($domain, $mofile); 298 298 } -
trunk/wp-includes/plugin.php
r6726 r7999 435 435 * plugin_basename() - Gets the basename of a plugin. 436 436 * 437 * This method extract the name of a plugin from its filename.437 * This method extracts the name of a plugin from its filename. 438 438 * 439 439 * @package WordPress … … 445 445 * @param string $file The filename of plugin. 446 446 * @return string The name of a plugin. 447 * @uses WP_PLUGIN_DIR 447 448 */ 448 449 function plugin_basename($file) { 449 450 $file = str_replace('\\','/',$file); // sanitize for Win32 installs 450 451 $file = preg_replace('|/+|','/', $file); // remove any duplicate slash 451 $file = preg_replace('|^.*/' . PLUGINDIR . '/|','',$file); // get relative path from plugins dir 452 $plugin_dir = str_replace('\\','/',WP_PLUGIN_DIR); // sanitize for Win32 installs 453 $plugin_dir = preg_replace('|/+|','/', $plugin_dir); // remove any duplicate slash 454 $file = preg_replace('|^' . preg_quote($plugin_dir, '|') . '/|','',$file); // get relative path from plugins dir 452 455 return $file; 453 456 } -
trunk/wp-includes/rss.php
r6585 r7999 652 652 653 653 class RSSCache { 654 var $BASE_CACHE = 'wp-content/cache'; // where the cache files are stored654 var $BASE_CACHE; // where the cache files are stored 655 655 var $MAX_AGE = 43200; // when are files stale, default twelve hours 656 656 var $ERROR = ''; // accumulate error messages 657 657 658 658 function RSSCache ($base='', $age='') { 659 $this->BASE_CACHE = WP_CONTENT_DIR . '/cache'; 659 660 if ( $base ) { 660 661 $this->BASE_CACHE = $base; -
trunk/wp-includes/theme.php
r7961 r7999 334 334 335 335 function get_theme_root() { 336 return apply_filters('theme_root', ABSPATH . "wp-content/themes");336 return apply_filters('theme_root', WP_CONTENT_DIR . "/themes"); 337 337 } 338 338 339 339 function get_theme_root_uri() { 340 return apply_filters('theme_root_uri', get_option('siteurl') . "/wp-content/themes", get_option('siteurl'));340 return apply_filters('theme_root_uri', WP_CONTENT_URL . "/themes", get_option('siteurl')); 341 341 } 342 342 -
trunk/wp-settings.php
r7998 r7999 101 101 } 102 102 103 if ( !extension_loaded('mysql') && !file_exists(ABSPATH . 'wp-content/db.php') ) 103 if ( !defined('WP_CONTENT_DIR') ) 104 define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' ); // no trailing slash, full paths only - WP_CONTENT_URL is defined further down 105 106 if ( !extension_loaded('mysql') && !file_exists(WP_CONTENT_DIR . '/db.php') ) 104 107 die( 'Your PHP installation appears to be missing the MySQL extension which is required by WordPress.' ); 105 108 … … 167 170 // For an advanced caching plugin to use, static because you would only want one 168 171 if ( defined('WP_CACHE') ) 169 @include ABSPATH . 'wp-content/advanced-cache.php';172 @include WP_CONTENT_DIR . '/advanced-cache.php'; 170 173 171 174 /** … … 176 179 define('WPINC', 'wp-includes'); 177 180 178 if ( !defined(' LANGDIR') ) {181 if ( !defined('WP_LANG_DIR') ) { 179 182 /** 180 * Stores the location of the language directory. First looks for language folder in wp-content183 * Stores the location of the language directory. First looks for language folder in WP_CONTENT_DIR 181 184 * and uses that folder if it exists. Or it uses the "languages" folder in WPINC. 182 185 * 183 186 * @since 2.1.0 184 187 */ 185 if ( file_exists(ABSPATH . 'wp-content/languages') && @is_dir(ABSPATH . 'wp-content/languages') ) 186 define('LANGDIR', 'wp-content/languages'); // no leading slash, no trailing slash 187 else 188 define('LANGDIR', WPINC . '/languages'); // no leading slash, no trailing slash 189 } 190 191 /** 192 * Allows for the plugins directory to be moved from the default location. 193 * 194 * This isn't used everywhere. Constant is not used in plugin_basename() 195 * which might cause conflicts with changing this. 196 * 197 * @since 2.1 198 */ 199 if ( !defined('PLUGINDIR') ) 200 define('PLUGINDIR', 'wp-content/plugins'); // no leading slash, no trailing slash 188 if ( file_exists(WP_CONTENT_DIR . '/languages') && @is_dir(WP_CONTENT_DIR . '/languages') ) { 189 define('WP_LANG_DIR', WP_CONTENT_DIR . '/languages'); // no leading slash, no trailing slash, full path, not relative to ABSPATH 190 if (!defined('LANGDIR')) { 191 // Old static relative path maintained for limited backwards compatibility - won't work in some cases 192 define('LANGDIR', 'wp-content/languages'); 193 } 194 } else { 195 define('WP_LANG_DIR', ABSPATH . WPINC . '/languages'); // no leading slash, no trailing slash, full path, not relative to ABSPATH 196 if (!defined('LANGDIR')) { 197 // Old relative path maintained for backwards compatibility 198 define('LANGDIR', WPINC . '/languages'); 199 } 200 } 201 } 201 202 202 203 require (ABSPATH . WPINC . '/compat.php'); … … 214 215 wp_die('<strong>ERROR</strong>: <code>$table_prefix</code> in <code>wp-config.php</code> can only contain numbers, letters, and underscores.'); 215 216 216 if ( file_exists( ABSPATH . 'wp-content/object-cache.php') )217 require_once ( ABSPATH . 'wp-content/object-cache.php');217 if ( file_exists(WP_CONTENT_DIR . '/object-cache.php') ) 218 require_once (WP_CONTENT_DIR . '/object-cache.php'); 218 219 else 219 220 require_once (ABSPATH . WPINC . '/cache.php'); … … 273 274 require (ABSPATH . WPINC . '/media.php'); 274 275 276 if ( !defined('WP_CONTENT_URL') ) 277 define( 'WP_CONTENT_URL', get_option('home') . '/wp-content'); // full url - WP_CONTENT_DIR is defined further up 278 279 /** 280 * Allows for the plugins directory to be moved from the default location. 281 * 282 * @since 2.6 283 */ 284 if ( !defined('WP_PLUGIN_DIR') ) 285 define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins' ); // full path, no trailing slash 286 if ( !defined('WP_PLUGIN_URL') ) 287 define( 'WP_PLUGIN_URL', WP_CONTENT_URL . '/plugins' ); // full url, no trailing slash 288 if ( !defined('PLUGINDIR') ) 289 define( 'PLUGINDIR', 'wp-content/plugins' ); // Relative to ABSPATH. For back compat. 290 275 291 if ( ! defined('WP_INSTALLING') ) { 276 292 // Used to guarantee unique hash cookies … … 365 381 if ( is_array($current_plugins) ) { 366 382 foreach ($current_plugins as $plugin) { 367 if ('' != $plugin && file_exists( ABSPATH . PLUGINDIR . '/' . $plugin))368 include_once( ABSPATH . PLUGINDIR . '/' . $plugin);383 if ('' != $plugin && file_exists(WP_PLUGIN_DIR . '/' . $plugin)) 384 include_once(WP_PLUGIN_DIR . '/' . $plugin); 369 385 } 370 386 } … … 459 475 */ 460 476 $locale = get_locale(); 461 $locale_file = ABSPATH . LANGDIR . "/$locale.php";477 $locale_file = WP_LANG_DIR . "/$locale.php"; 462 478 if ( is_readable($locale_file) ) 463 479 require_once($locale_file);
Note: See TracChangeset
for help on using the changeset viewer.