Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 651 lines (557 sloc) 20.418 kB
0bc8613 b2config.php replaced with wp-config.sample.php
mikelittle authored
1 <?php
75dc778 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
westi authored
2 /**
3 * Used to setup and fix common variables and include
4 * the WordPress procedural and class library.
5 *
479fc2e phpdoc tuneup from darkdragon. see #5611
ryan authored
6 * You should not have to change this file and allows
7 * for some configuration in wp-config.php.
75dc778 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
westi authored
8 *
9 * @package WordPress
10 */
11
5c2f29c Increase memory limit. Props darkdragon. see #3141
ryan authored
12 if ( !defined('WP_MEMORY_LIMIT') )
13 define('WP_MEMORY_LIMIT', '32M');
14
a5246f5 absint is not defined yet. see #4762
ryan authored
15 if ( function_exists('memory_get_usage') && ( (int) @ini_get('memory_limit') < abs(intval(WP_MEMORY_LIMIT)) ) )
5c2f29c Increase memory limit. Props darkdragon. see #3141
ryan authored
16 @ini_set('memory_limit', WP_MEMORY_LIMIT);
17
8b34959 Turn off magic_quotes_sybase. It prevents addslashes from escaping ba…
ryan authored
18 set_magic_quotes_runtime(0);
19 @ini_set('magic_quotes_sybase', 0);
6e181bb Multi-byte character safe excerpting from nbachiyski. fixes #6077
ryan authored
20
75dc778 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
westi authored
21 /**
3fc6097 phpdoc corrections from jacobsantos. see #7918
ryan authored
22 * Turn register globals off.
75dc778 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
westi authored
23 *
24 * @access private
479fc2e phpdoc tuneup from darkdragon. see #5611
ryan authored
25 * @since 2.1.0
75dc778 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
westi authored
26 * @return null Will return null if register_globals PHP directive was disabled
27 */
d4f95b7 Accidental commit. Props Nazgul. fixes #4437
rob1n authored
28 function wp_unregister_GLOBALS() {
29 if ( !ini_get('register_globals') )
30 return;
dce5220 Typos and more secure unsetting. Hat tip: Stefen Esser
matt authored
31
d4f95b7 Accidental commit. Props Nazgul. fixes #4437
rob1n authored
32 if ( isset($_REQUEST['GLOBALS']) )
33 die('GLOBALS overwrite attempt detected');
34
35 // Variables that shouldn't be unset
36 $noUnset = array('GLOBALS', '_GET', '_POST', '_COOKIE', '_REQUEST', '_SERVER', '_ENV', '_FILES', 'table_prefix');
37
38 $input = array_merge($_GET, $_POST, $_COOKIE, $_SERVER, $_ENV, $_FILES, isset($_SESSION) && is_array($_SESSION) ? $_SESSION : array());
321c310 Remove trailing whitespace
ryan authored
39 foreach ( $input as $k => $v )
d4f95b7 Accidental commit. Props Nazgul. fixes #4437
rob1n authored
40 if ( !in_array($k, $noUnset) && isset($GLOBALS[$k]) ) {
9323d39 Zend hash del key or index fix. PRops MarkJaquith.
ryan authored
41 $GLOBALS[$k] = NULL;
d4f95b7 Accidental commit. Props Nazgul. fixes #4437
rob1n authored
42 unset($GLOBALS[$k]);
9323d39 Zend hash del key or index fix. PRops MarkJaquith.
ryan authored
43 }
2919fe2 That last thing didn't work at all.
matt authored
44 }
877e6a7 Turn register globals off. Hat tip: Christian Schmidt
matt authored
45
321c310 Remove trailing whitespace
ryan authored
46 wp_unregister_GLOBALS();
d4f95b7 Accidental commit. Props Nazgul. fixes #4437
rob1n authored
47
479fc2e phpdoc tuneup from darkdragon. see #5611
ryan authored
48 unset( $wp_filter, $cache_lastcommentmodified, $cache_lastpostdate );
376ec4d Tweak
matt authored
49
75dc778 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
westi authored
50 /**
51 * The $blog_id global, which you can change in the config allows you to create a simple
52 * multiple blog installation using just one WordPress and changing $blog_id around.
53 *
54 * @global int $blog_id
479fc2e phpdoc tuneup from darkdragon. see #5611
ryan authored
55 * @since 2.0.0
75dc778 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
westi authored
56 */
d4f95b7 Accidental commit. Props Nazgul. fixes #4437
rob1n authored
57 if ( ! isset($blog_id) )
85723b8 Object caching, round one.
ryan authored
58 $blog_id = 1;
59
a18a23e Work around IIS' lack of REQUEST_URI
saxmatt authored
60 // Fix for IIS, which doesn't set REQUEST_URI
40a7d9d Fixes #1488
matt authored
61 if ( empty( $_SERVER['REQUEST_URI'] ) ) {
dd202ce Death to trailing tabs. Props Mark J. fixes #2405
ryan authored
62
54639a3 Set REQUEST_URI for IIS in more situations. props snakefoot. fixes …
markjaquith authored
63 // IIS Mod-Rewrite
64 if (isset($_SERVER['HTTP_X_ORIGINAL_URL'])) {
65 $_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_ORIGINAL_URL'];
66 }
67 // IIS Isapi_Rewrite
68 else if (isset($_SERVER['HTTP_X_REWRITE_URL'])) {
69 $_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_REWRITE_URL'];
70 }
c698c97 IIS REQUEST_URI-setting fixes from snakefoot. fixes #5160 for trunk
markjaquith authored
71 else
72 {
a3a1f83 Use ORIG_PATH_INFO if PATH_INFO is not available. fixes #7058 for trunk
ryan authored
73 // Use ORIG_PATH_INFO if there is no PATH_INFO
74 if ( !isset($_SERVER['PATH_INFO']) && isset($_SERVER['ORIG_PATH_INFO']) )
75 $_SERVER['PATH_INFO'] = $_SERVER['ORIG_PATH_INFO'];
76
c698c97 IIS REQUEST_URI-setting fixes from snakefoot. fixes #5160 for trunk
markjaquith authored
77 // Some IIS + PHP configurations puts the script-name in the path-info (No need to append it twice)
8d6d1af Check if PATH_INFO is set to avoid undefined index errors. see #5160
ryan authored
78 if ( isset($_SERVER['PATH_INFO']) ) {
79 if ( $_SERVER['PATH_INFO'] == $_SERVER['SCRIPT_NAME'] )
80 $_SERVER['REQUEST_URI'] = $_SERVER['PATH_INFO'];
81 else
82 $_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'] . $_SERVER['PATH_INFO'];
83 }
87c4f3a Strip lines that contain only whitespace down to newlines.
ryan authored
84
54639a3 Set REQUEST_URI for IIS in more situations. props snakefoot. fixes …
markjaquith authored
85 // Append the query string if it exists and isn't null
86 if (isset($_SERVER['QUERY_STRING']) && !empty($_SERVER['QUERY_STRING'])) {
87 $_SERVER['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
88 }
720316d Do not touch REQUEST_URI if it is already set by the server.
rboren authored
89 }
12b4069 Fix REQUEST_URI construction for IIS. Bug 389. Patch from Dennis Wi…
rboren authored
90 }
a18a23e Work around IIS' lack of REQUEST_URI
saxmatt authored
91
c50e7da Fixes #1591 (again)
matt authored
92 // Fix for PHP as CGI hosts that set SCRIPT_FILENAME to something ending in php.cgi for all requests
c1ed565 Check if SCRIPT_FILENAME is set to avoid warnings. fixes #2227
ryan authored
93 if ( isset($_SERVER['SCRIPT_FILENAME']) && ( strpos($_SERVER['SCRIPT_FILENAME'], 'php.cgi') == strlen($_SERVER['SCRIPT_FILENAME']) - 7 ) )
c50e7da Fixes #1591 (again)
matt authored
94 $_SERVER['SCRIPT_FILENAME'] = $_SERVER['PATH_TRANSLATED'];
95
885ee8f This should fix permalinks, but may break the PHP as CGI funkiness again
matt authored
96 // Fix for Dreamhost and other PHP as CGI hosts
3320dd1 Use strpos instead of strstr where ever possible, for speed. Props r…
markjaquith authored
97 if (strpos($_SERVER['SCRIPT_NAME'], 'php.cgi') !== false)
c50e7da Fixes #1591 (again)
matt authored
98 unset($_SERVER['PATH_INFO']);
99
38f4fca Move PHP_SELF setup to wp-settings.php. #2153
ryan authored
100 // Fix empty PHP_SELF
101 $PHP_SELF = $_SERVER['PHP_SELF'];
102 if ( empty($PHP_SELF) )
103 $_SERVER['PHP_SELF'] = $PHP_SELF = preg_replace("/(\?.*)?$/",'',$_SERVER["REQUEST_URI"]);
885ee8f This should fix permalinks, but may break the PHP as CGI funkiness again
matt authored
104
f3d0aae Require PHP 4.3
ryan authored
105 if ( version_compare( '4.3', phpversion(), '>' ) ) {
e122618 Fix typo in wp-settings.php. Props mictasm, fixes #7638
azaozz authored
106 die( sprintf( /*WP_I18N_OLD_PHP*/'Your server is running PHP version %s but WordPress requires at least 4.3.'/*/WP_I18N_OLD_PHP*/, phpversion() ) );
629dde8 Actually check for PHP 4.2. Props nbachiyski. fixes #4336
rob1n authored
107 }
da4a0d9 Fix for empty plugin strings, class include moved for timing.
saxmatt authored
108
6c8d35d Allow wp-content to exist outside of webroot. Props sambauers. see #6938
ryan authored
109 if ( !defined('WP_CONTENT_DIR') )
110 define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' ); // no trailing slash, full paths only - WP_CONTENT_URL is defined further down
111
c209f15 Don't die with 503 if WP_INSTALLING. Don't load plugins if WP_INSTALL…
ryan authored
112 if ( file_exists(ABSPATH . '.maintenance') && !defined('WP_INSTALLING') ) {
d7fccb6 Sanitation and error handling for plugin install. Props DD32. see #6015
ryan authored
113 include(ABSPATH . '.maintenance');
114 // If the $upgrading timestamp is older than 10 minutes, don't die.
115 if ( ( time() - $upgrading ) < 600 ) {
116 if ( file_exists( WP_CONTENT_DIR . '/maintenance.php' ) ) {
117 require_once( WP_CONTENT_DIR . '/maintenance.php' );
118 die();
119 }
0530546 Automatic upgrade, first cut. see #5560
ryan authored
120
d7fccb6 Sanitation and error handling for plugin install. Props DD32. see #6015
ryan authored
121 $protocol = $_SERVER["SERVER_PROTOCOL"];
122 if ( 'HTTP/1.1' != $protocol && 'HTTP/1.0' != $protocol )
123 $protocol = 'HTTP/1.0';
124 header( "$protocol 503 Service Unavailable", true, 503 );
125 header( 'Content-Type: text/html; charset=utf-8' );
0530546 Automatic upgrade, first cut. see #5560
ryan authored
126 ?>
127 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
128 <html xmlns="http://www.w3.org/1999/xhtml">
129 <head>
130 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
131 <title>Maintenance</title>
132
133 </head>
134 <body>
135 <h1>Briefly unavailable for scheduled maintenance. Check back in a minute.</h1>
136 </body>
137 </html>
138 <?php
d7fccb6 Sanitation and error handling for plugin install. Props DD32. see #6015
ryan authored
139 die();
140 }
0530546 Automatic upgrade, first cut. see #5560
ryan authored
141 }
142
6c8d35d Allow wp-content to exist outside of webroot. Props sambauers. see #6938
ryan authored
143 if ( !extension_loaded('mysql') && !file_exists(WP_CONTENT_DIR . '/db.php') )
f42b96c Mark string that cannot be gettexted. Props nbachiyski. fixes #7074
ryan authored
144 die( /*WP_I18N_OLD_MYSQL*/'Your PHP installation appears to be missing the MySQL extension which is required by WordPress.'/*/WP_I18N_OLD_MYSQL*/ );
0d040b3 Sanity check mysql.
saxmatt authored
145
75dc778 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
westi authored
146 /**
3fc6097 phpdoc corrections from jacobsantos. see #7918
ryan authored
147 * PHP 4 standard microtime start capture.
75dc778 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
westi authored
148 *
149 * @access private
479fc2e phpdoc tuneup from darkdragon. see #5611
ryan authored
150 * @since 0.71
3fc6097 phpdoc corrections from jacobsantos. see #7918
ryan authored
151 * @global int $timestart Seconds and Microseconds added together from when function is called.
152 * @return bool Always returns true.
75dc778 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
westi authored
153 */
551e52f Code cleanup and some fixes from the WP Japan folks.
saxmatt authored
154 function timer_start() {
155 global $timestart;
156 $mtime = explode(' ', microtime() );
157 $mtime = $mtime[1] + $mtime[0];
158 $timestart = $mtime;
159 return true;
160 }
0f7bb42 timer_stop() wanted to be near timer_start().
ryan authored
161
75dc778 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
westi authored
162 /**
3fc6097 phpdoc corrections from jacobsantos. see #7918
ryan authored
163 * Return and/or display the time from the page start to when function is called.
75dc778 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
westi authored
164 *
165 * You can get the results and print them by doing:
166 * <code>
167 * $nTimePageTookToExecute = timer_stop();
168 * echo $nTimePageTookToExecute;
169 * </code>
170 *
171 * Or instead, you can do:
172 * <code>
173 * timer_stop(1);
174 * </code>
175 * which will do what the above does. If you need the result, you can assign it to a variable, but
176 * most cases, you only need to echo it.
177 *
6950e28 Fix @since for timer_start and timer_stop. See #5211.
westi authored
178 * @since 0.71
75dc778 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
westi authored
179 * @global int $timestart Seconds and Microseconds added together from when timer_start() is called
180 * @global int $timeend Seconds and Microseconds added together from when function is called
181 *
182 * @param int $display Use '0' or null to not echo anything and 1 to echo the total time
183 * @param int $precision The amount of digits from the right of the decimal to display. Default is 3.
184 * @return float The "second.microsecond" finished time calculation
185 */
0f7bb42 timer_stop() wanted to be near timer_start().
ryan authored
186 function timer_stop($display = 0, $precision = 3) { //if called like timer_stop(1), will echo $timetotal
187 global $timestart, $timeend;
188 $mtime = microtime();
189 $mtime = explode(' ',$mtime);
190 $mtime = $mtime[1] + $mtime[0];
191 $timeend = $mtime;
192 $timetotal = $timeend-$timestart;
4f6b825 Make sure number_format_i18n() is available before calling it in time…
markjaquith authored
193 $r = ( function_exists('number_format_i18n') ) ? number_format_i18n($timetotal, $precision) : number_format($timetotal, $precision);
0f7bb42 timer_stop() wanted to be near timer_start().
ryan authored
194 if ( $display )
a9d23d4 allow timer_stop() to use number_format() when returning. Props mdaw…
markjaquith authored
195 echo $r;
196 return $r;
0f7bb42 timer_stop() wanted to be near timer_start().
ryan authored
197 }
551e52f Code cleanup and some fixes from the WP Japan folks.
saxmatt authored
198 timer_start();
da4a0d9 Fix for empty plugin strings, class include moved for timing.
saxmatt authored
199
f3e26c6 s/WPDEBUG/WP_DEBUG/g Fixes #5033
westi authored
200 // Add define('WP_DEBUG',true); to wp-config.php to enable display of notices during development.
201 if (defined('WP_DEBUG') and WP_DEBUG == true) {
479fc2e phpdoc tuneup from darkdragon. see #5611
ryan authored
202 error_reporting(E_ALL);
2bcddfc Enable developers to turn on notices from wp-config.php. Relates #315…
westi authored
203 } else {
cbe2d8b Error reporting (again\!) See #8701 props jacobsantos.
westi authored
204 // Unicode Extension is in PHP 6.0 only or do version check when this changes.
88838cc Use the correct PHP6 check.
westi authored
205 if ( function_exists('unicode_decode') )
cbe2d8b Error reporting (again\!) See #8701 props jacobsantos.
westi authored
206 error_reporting( E_ALL ^ E_DEPRECATED ^ E_NOTICE ^ E_USER_NOTICE ^ E_STRICT );
207 else if ( defined( 'E_DEPRECATED' ) ) // Introduced in PHP 5.3
208 error_reporting( E_ALL ^ E_DEPRECATED ^ E_NOTICE ^ E_USER_NOTICE );
0c9e106 Update error_reporting configuration for newer version of PHP. Fixes …
westi authored
209 else
210 error_reporting(E_ALL ^ E_NOTICE ^ E_USER_NOTICE);
2bcddfc Enable developers to turn on notices from wp-config.php. Relates #315…
westi authored
211 }
9b09572 Turn down error reporting.
saxmatt authored
212
70a449d Allow for plugins to kick in before everything if define in wp-config
saxmatt authored
213 // For an advanced caching plugin to use, static because you would only want one
214 if ( defined('WP_CACHE') )
6c8d35d Allow wp-content to exist outside of webroot. Props sambauers. see #6938
ryan authored
215 @include WP_CONTENT_DIR . '/advanced-cache.php';
70a449d Allow for plugins to kick in before everything if define in wp-config
saxmatt authored
216
75dc778 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
westi authored
217 /**
218 * Stores the location of the WordPress directory of functions, classes, and core content.
219 *
479fc2e phpdoc tuneup from darkdragon. see #5611
ryan authored
220 * @since 1.0.0
75dc778 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
westi authored
221 */
edc7d7c Installation cleanup.
saxmatt authored
222 define('WPINC', 'wp-includes');
54d7ccb make /languages/ directory default to /wp-content/languages/ with fal…
markjaquith authored
223
a5d9355 Revert 8562 (last was incorrect)
azaozz authored
224 if ( !defined('WP_LANG_DIR') ) {
225 /**
226 * Stores the location of the language directory. First looks for language folder in WP_CONTENT_DIR
227 * and uses that folder if it exists. Or it uses the "languages" folder in WPINC.
228 *
229 * @since 2.1.0
0c6394a Stop fatal error in post revisions when setting the include path is d…
azaozz authored
230 */
a5d9355 Revert 8562 (last was incorrect)
azaozz authored
231 if ( file_exists(WP_CONTENT_DIR . '/languages') && @is_dir(WP_CONTENT_DIR . '/languages') ) {
232 define('WP_LANG_DIR', WP_CONTENT_DIR . '/languages'); // no leading slash, no trailing slash, full path, not relative to ABSPATH
233 if (!defined('LANGDIR')) {
234 // Old static relative path maintained for limited backwards compatibility - won't work in some cases
235 define('LANGDIR', 'wp-content/languages');
236 }
237 } else {
238 define('WP_LANG_DIR', ABSPATH . WPINC . '/languages'); // no leading slash, no trailing slash, full path, not relative to ABSPATH
239 if (!defined('LANGDIR')) {
240 // Old relative path maintained for backwards compatibility
241 define('LANGDIR', WPINC . '/languages');
242 }
243 }
0c6394a Stop fatal error in post revisions when setting the include path is d…
azaozz authored
244 }
245
b36471d Use wp_die() for WPDB bails. Send 500 response and no-cache headers …
markjaquith authored
246 require (ABSPATH . WPINC . '/compat.php');
247 require (ABSPATH . WPINC . '/functions.php');
1d0bf72 AJAX for link category add and delete. Props mdawaffe. fixes #5291
ryan authored
248 require (ABSPATH . WPINC . '/classes.php');
b36471d Use wp_die() for WPDB bails. Send 500 response and no-cache headers …
markjaquith authored
249
cb712c9 Only list field types that are not strings. see #7171
ryan authored
250 /**
251 * Format specifiers for DB columns. Columns not listed here default to %s.
252 * @since 2.8.0
253 */
254 $db_field_types = array( 'post_author' => '%d', 'post_parent' => '%d', 'menu_order' => '%d', 'term_id' => '%d', 'term_group' => '%d', 'term_taxonomy_id' => '%d',
255 'parent' => '%d', 'count' => '%d','object_id' => '%d', 'term_order' => '%d', 'ID' => '%d', 'commment_ID' => '%d', 'comment_post_ID' => '%d', 'comment_parent' => '%d',
256 'user_id' => '%d', 'link_id' => '%d', 'link_owner' => '%d', 'link_rating' => '%d', 'option_id' => '%d', 'blog_id' => '%d', 'meta_id' => '%d', 'post_id' => '%d',
c188678 Use wpdb::insert() and update(). see #6836
ryan authored
257 'user_status' => '%d', 'umeta_id' => '%d', 'comment_karma' => '%d', 'comment_count' => '%d');
d6ee606 Add some default field types. see #7171
ryan authored
258
61f8b8f Move database class loading to a shared function to ensure all of Wor…
westi authored
259 require_wp_db();
e8dc869 Custom DB error page. fixes #5500 for 2.4
ryan authored
260
261 if ( !empty($wpdb->error) )
262 dead_db();
263
1d0bf72 AJAX for link category add and delete. Props mdawaffe. fixes #5291
ryan authored
264 $prefix = $wpdb->set_prefix($table_prefix);
71a2674 Use $wpdb->prefix when defining table names
markjaquith authored
265
1d0bf72 AJAX for link category add and delete. Props mdawaffe. fixes #5291
ryan authored
266 if ( is_wp_error($prefix) )
f42b96c Mark string that cannot be gettexted. Props nbachiyski. fixes #7074
ryan authored
267 wp_die(/*WP_I18N_BAD_PREFIX*/'<strong>ERROR</strong>: <code>$table_prefix</code> in <code>wp-config.php</code> can only contain numbers, letters, and underscores.'/*/WP_I18N_BAD_PREFIX*/);
cde68f9 Exit gracefully with a warning if the table_prefix uses disallowed ch…
markjaquith authored
268
f1d3350 Flag if using external object cache. see #9048
ryan authored
269 if ( file_exists(WP_CONTENT_DIR . '/object-cache.php') ) {
6c8d35d Allow wp-content to exist outside of webroot. Props sambauers. see #6938
ryan authored
270 require_once (WP_CONTENT_DIR . '/object-cache.php');
f1d3350 Flag if using external object cache. see #9048
ryan authored
271 $_wp_using_ext_object_cache = true;
272 } else {
b3d3d73 Require once only. Props masquerade. fixes #4192
rob1n authored
273 require_once (ABSPATH . WPINC . '/cache.php');
f1d3350 Flag if using external object cache. see #9048
ryan authored
274 $_wp_using_ext_object_cache = false;
275 }
85723b8 Object caching, round one.
ryan authored
276
277 wp_cache_init();
58e47dc wp_cache_add_global_groups() and wp_cache_add_non_persistent_groups()…
ryan authored
278 if ( function_exists('wp_cache_add_global_groups') ) {
279 wp_cache_add_global_groups(array ('users', 'userlogins', 'usermeta'));
b666a1c Cache get_plugins() list. Props DD32. fixes #7113
ryan authored
280 wp_cache_add_non_persistent_groups(array( 'comment', 'counts', 'plugins' ));
58e47dc wp_cache_add_global_groups() and wp_cache_add_non_persistent_groups()…
ryan authored
281 }
85723b8 Object caching, round one.
ryan authored
282
6d7717e Move plugin API to plugin.php. #2525
ryan authored
283 require (ABSPATH . WPINC . '/plugin.php');
81e7d92 Some filter action and cleanup
saxmatt authored
284 require (ABSPATH . WPINC . '/default-filters.php');
5dfddd7 Switch to pomo lib. Support gettext contexts. Deprecate long form fu…
ryan authored
285 include_once(ABSPATH . WPINC . '/pomo/mo.php');
62927ab Remove wp- prefix from wp-l10n.php
ryan authored
286 require_once (ABSPATH . WPINC . '/l10n.php');
1bd4057 Bug fixes
saxmatt authored
287
3320dd1 Use strpos instead of strstr where ever possible, for speed. Props r…
markjaquith authored
288 if ( !is_blog_installed() && (strpos($_SERVER['PHP_SELF'], 'install.php') === false && !defined('WP_INSTALLING')) ) {
25abcd1 More streamlined install process. Obeys WP_SITEURL if defined. fixes…
markjaquith authored
289 if ( defined('WP_SITEURL') )
321c310 Remove trailing whitespace
ryan authored
290 $link = WP_SITEURL . '/wp-admin/install.php';
25abcd1 More streamlined install process. Obeys WP_SITEURL if defined. fixes…
markjaquith authored
291 elseif (strpos($_SERVER['PHP_SELF'], 'wp-admin') !== false)
292 $link = preg_replace('|/wp-admin/?.*?$|', '/', $_SERVER['PHP_SELF']) . 'wp-admin/install.php';
ca2815f If we're already in wp-admin don't recursive link
saxmatt authored
293 else
25abcd1 More streamlined install process. Obeys WP_SITEURL if defined. fixes…
markjaquith authored
294 $link = preg_replace('|/[^/]+?$|', '/', $_SERVER['PHP_SELF']) . 'wp-admin/install.php';
295 require_once(ABSPATH . WPINC . '/kses.php');
296 require_once(ABSPATH . WPINC . '/pluggable.php');
297 wp_redirect($link);
298 die(); // have to die here ~ Mark
ca2815f If we're already in wp-admin don't recursive link
saxmatt authored
299 }
1bd4057 Bug fixes
saxmatt authored
300
c93efa8 Include file renames. #2525
ryan authored
301 require (ABSPATH . WPINC . '/formatting.php');
a6ade4a Role/capability system. Round one. Props: Owen Winkler
ryan authored
302 require (ABSPATH . WPINC . '/capabilities.php');
9303053 Move WP_Query and its wrapper functions to query.php. #2525
ryan authored
303 require (ABSPATH . WPINC . '/query.php');
40b2e61 Move theme functions to theme.php. #2525
ryan authored
304 require (ABSPATH . WPINC . '/theme.php');
c56e62f Move user functions to user.php. Relocate more post functions to pos…
ryan authored
305 require (ABSPATH . WPINC . '/user.php');
c93efa8 Include file renames. #2525
ryan authored
306 require (ABSPATH . WPINC . '/general-template.php');
307 require (ABSPATH . WPINC . '/link-template.php');
c56e62f Move user functions to user.php. Relocate more post functions to pos…
ryan authored
308 require (ABSPATH . WPINC . '/author-template.php');
3c8ed76 Reworg post/page/attachment functions. #2525
ryan authored
309 require (ABSPATH . WPINC . '/post.php');
310 require (ABSPATH . WPINC . '/post-template.php');
0f5dc0f Reorg category functions. #2525
ryan authored
311 require (ABSPATH . WPINC . '/category.php');
312 require (ABSPATH . WPINC . '/category-template.php');
6027cfa Reorg comment functions. #2525
ryan authored
313 require (ABSPATH . WPINC . '/comment.php');
314 require (ABSPATH . WPINC . '/comment-template.php');
6970a75 Rewrite API additions and improvements from David House. #2433
ryan authored
315 require (ABSPATH . WPINC . '/rewrite.php');
c93efa8 Include file renames. #2525
ryan authored
316 require (ABSPATH . WPINC . '/feed.php');
19ea5fb Reorg bookmark functions. #2525
ryan authored
317 require (ABSPATH . WPINC . '/bookmark.php');
318 require (ABSPATH . WPINC . '/bookmark-template.php');
9dc65ab Cleaning up some includes.
saxmatt authored
319 require (ABSPATH . WPINC . '/kses.php');
fb1e531 Cron improvements from masquerade. #2425
ryan authored
320 require (ABSPATH . WPINC . '/cron.php');
2520d8e Include cleanups
saxmatt authored
321 require (ABSPATH . WPINC . '/version.php');
ca92bb4 Move deprecated functions to deprecated.php. #2520
ryan authored
322 require (ABSPATH . WPINC . '/deprecated.php');
4d49e98 Script loader from mdawaffe. #2701
ryan authored
323 require (ABSPATH . WPINC . '/script-loader.php');
634a33c Very rough initial commit of taxonomy for everyone's hacking pleasure…
ryan authored
324 require (ABSPATH . WPINC . '/taxonomy.php');
7c2dbb9 First pass at upgrade notification for core, see #1476. Also includes…
matt authored
325 require (ABSPATH . WPINC . '/update.php');
6fc031d Canonical URLs, first swing. Props to Scott Yang, Ryan and Matt. se…
markjaquith authored
326 require (ABSPATH . WPINC . '/canonical.php');
f529123 First pass at async upload, multi-upload, and gallery feature. Modifi…
matt authored
327 require (ABSPATH . WPINC . '/shortcodes.php');
833447d Image size options from tellyworth. fixes #5933
ryan authored
328 require (ABSPATH . WPINC . '/media.php');
3c99cfc HTTP POST and REQUEST API from jacobsantos. see #4779
ryan authored
329 require (ABSPATH . WPINC . '/http.php');
da4a0d9 Fix for empty plugin strings, class include moved for timing.
saxmatt authored
330
6c8d35d Allow wp-content to exist outside of webroot. Props sambauers. see #6938
ryan authored
331 if ( !defined('WP_CONTENT_URL') )
995fe00 Use siteurl instead of home. Props msi08. fixes #7050
ryan authored
332 define( 'WP_CONTENT_URL', get_option('siteurl') . '/wp-content'); // full url - WP_CONTENT_DIR is defined further up
6c8d35d Allow wp-content to exist outside of webroot. Props sambauers. see #6938
ryan authored
333
334 /**
335 * Allows for the plugins directory to be moved from the default location.
336 *
3fc6097 phpdoc corrections from jacobsantos. see #7918
ryan authored
337 * @since 2.6.0
6c8d35d Allow wp-content to exist outside of webroot. Props sambauers. see #6938
ryan authored
338 */
339 if ( !defined('WP_PLUGIN_DIR') )
340 define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins' ); // full path, no trailing slash
3fc6097 phpdoc corrections from jacobsantos. see #7918
ryan authored
341
342 /**
343 * Allows for the plugins directory to be moved from the default location.
344 *
345 * @since 2.6.0
346 */
6c8d35d Allow wp-content to exist outside of webroot. Props sambauers. see #6938
ryan authored
347 if ( !defined('WP_PLUGIN_URL') )
348 define( 'WP_PLUGIN_URL', WP_CONTENT_URL . '/plugins' ); // full url, no trailing slash
3fc6097 phpdoc corrections from jacobsantos. see #7918
ryan authored
349
350 /**
351 * Allows for the plugins directory to be moved from the default location.
352 *
353 * @since 2.1.0
354 */
6c8d35d Allow wp-content to exist outside of webroot. Props sambauers. see #6938
ryan authored
355 if ( !defined('PLUGINDIR') )
356 define( 'PLUGINDIR', 'wp-content/plugins' ); // Relative to ABSPATH. For back compat.
357
545da15 Notice fixes from DD32. see #7509
ryan authored
358 /**
3bf4ed1 Support mu-plugins for 'Must Use' autoload plugins
ryan authored
359 * Allows for the mu-plugins directory to be moved from the default location.
360 *
361 * @since 2.8.0
362 */
363 if ( !defined('WPMU_PLUGIN_DIR') )
364 define( 'WPMU_PLUGIN_DIR', WP_CONTENT_DIR . '/mu-plugins' ); // full path, no trailing slash
365
366 /**
367 * Allows for the mu-plugins directory to be moved from the default location.
368 *
369 * @since 2.8.0
370 */
371 if ( !defined('WPMU_PLUGIN_URL') )
372 define( 'WPMU_PLUGIN_URL', WP_CONTENT_URL . '/mu-plugins' ); // full url, no trailing slash
373
374 /**
375 * Allows for the mu-plugins directory to be moved from the default location.
376 *
377 * @since 2.8.0
378 */
379 if ( !defined( 'MUPLUGINDIR' ) )
380 define( 'MUPLUGINDIR', 'wp-content/mu-plugins' ); // Relative to ABSPATH. For back compat.
381
382 if ( is_dir( WPMU_PLUGIN_DIR ) ) {
383 if ( $dh = opendir( WPMU_PLUGIN_DIR ) ) {
384 while ( ( $plugin = readdir( $dh ) ) !== false ) {
385 if ( substr( $plugin, -4 ) == '.php' ) {
386 include_once( WPMU_PLUGIN_DIR . '/' . $plugin );
387 }
388 }
389 }
390 }
391 do_action('muplugins_loaded');
392
393 /**
545da15 Notice fixes from DD32. see #7509
ryan authored
394 * Used to guarantee unique hash cookies
395 * @since 1.5
396 */
397 define('COOKIEHASH', md5(get_option('siteurl')));
5c97b54 Smilie fix from Jaykul, changed fool's siteurl fix to use faster preg…
saxmatt authored
398
75dc778 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
westi authored
399 /**
54f091e Allow overriding the default secret key. Proy. Props nbachiyski. fixe…
ryan authored
400 * Should be exactly the same as the default value of SECRET_KEY in wp-config-sample.php
3fc6097 phpdoc corrections from jacobsantos. see #7918
ryan authored
401 * @since 2.5.0
54f091e Allow overriding the default secret key. Proy. Props nbachiyski. fixe…
ryan authored
402 */
403 $wp_default_secret_key = 'put your unique phrase here';
404
405 /**
75dc778 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
westi authored
406 * It is possible to define this in wp-config.php
479fc2e phpdoc tuneup from darkdragon. see #5611
ryan authored
407 * @since 2.0.0
75dc778 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
westi authored
408 */
41afea2 Let advanced users override cookies.
matt authored
409 if ( !defined('USER_COOKIE') )
29ef8b6 New secure cookie protocol. see #5367
ryan authored
410 define('USER_COOKIE', 'wordpressuser_' . COOKIEHASH);
75dc778 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
westi authored
411
412 /**
413 * It is possible to define this in wp-config.php
479fc2e phpdoc tuneup from darkdragon. see #5611
ryan authored
414 * @since 2.0.0
75dc778 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
westi authored
415 */
41afea2 Let advanced users override cookies.
matt authored
416 if ( !defined('PASS_COOKIE') )
29ef8b6 New secure cookie protocol. see #5367
ryan authored
417 define('PASS_COOKIE', 'wordpresspass_' . COOKIEHASH);
75dc778 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
westi authored
418
419 /**
420 * It is possible to define this in wp-config.php
3fc6097 phpdoc corrections from jacobsantos. see #7918
ryan authored
421 * @since 2.5.0
75dc778 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
westi authored
422 */
29ef8b6 New secure cookie protocol. see #5367
ryan authored
423 if ( !defined('AUTH_COOKIE') )
424 define('AUTH_COOKIE', 'wordpress_' . COOKIEHASH);
75dc778 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
westi authored
425
426 /**
427 * It is possible to define this in wp-config.php
3fc6097 phpdoc corrections from jacobsantos. see #7918
ryan authored
428 * @since 2.6.0
9771ec5 First cut and better admin SSL support. see #7001
ryan authored
429 */
430 if ( !defined('SECURE_AUTH_COOKIE') )
431 define('SECURE_AUTH_COOKIE', 'wordpress_sec_' . COOKIEHASH);
432
433 /**
434 * It is possible to define this in wp-config.php
3fc6097 phpdoc corrections from jacobsantos. see #7918
ryan authored
435 * @since 2.6.0
6adcab8 Introduce logged_in cookie. Deliver auth cookies only to wp-admin. s…
ryan authored
436 */
437 if ( !defined('LOGGED_IN_COOKIE') )
438 define('LOGGED_IN_COOKIE', 'wordpress_logged_in_' . COOKIEHASH);
439
440 /**
441 * It is possible to define this in wp-config.php
479fc2e phpdoc tuneup from darkdragon. see #5611
ryan authored
442 * @since 2.3.0
75dc778 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
westi authored
443 */
2662be2 Inform the user when cookies are disabled and login fails. Fixed #203…
westi authored
444 if ( !defined('TEST_COOKIE') )
445 define('TEST_COOKIE', 'wordpress_test_cookie');
75dc778 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
westi authored
446
447 /**
448 * It is possible to define this in wp-config.php
479fc2e phpdoc tuneup from darkdragon. see #5611
ryan authored
449 * @since 1.2.0
75dc778 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
westi authored
450 */
41afea2 Let advanced users override cookies.
matt authored
451 if ( !defined('COOKIEPATH') )
849a0d2 Use get_option instead of get_settings. Just 'cause.
ryan authored
452 define('COOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_option('home') . '/' ) );
75dc778 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
westi authored
453
454 /**
455 * It is possible to define this in wp-config.php
479fc2e phpdoc tuneup from darkdragon. see #5611
ryan authored
456 * @since 1.5.0
75dc778 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
westi authored
457 */
41afea2 Let advanced users override cookies.
matt authored
458 if ( !defined('SITECOOKIEPATH') )
849a0d2 Use get_option instead of get_settings. Just 'cause.
ryan authored
459 define('SITECOOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_option('siteurl') . '/' ) );
75dc778 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
westi authored
460
461 /**
462 * It is possible to define this in wp-config.php
3fc6097 phpdoc corrections from jacobsantos. see #7918
ryan authored
463 * @since 2.6.0
775ea98 Set auth cookie for plugins directory to support direct load plugin f…
ryan authored
464 */
465 if ( !defined('ADMIN_COOKIE_PATH') )
466 define( 'ADMIN_COOKIE_PATH', SITECOOKIEPATH . 'wp-admin' );
467
468 /**
469 * It is possible to define this in wp-config.php
3fc6097 phpdoc corrections from jacobsantos. see #7918
ryan authored
470 * @since 2.6.0
775ea98 Set auth cookie for plugins directory to support direct load plugin f…
ryan authored
471 */
472 if ( !defined('PLUGINS_COOKIE_PATH') )
473 define( 'PLUGINS_COOKIE_PATH', preg_replace('|https?://[^/]+|i', '', WP_PLUGIN_URL) );
474
475 /**
476 * It is possible to define this in wp-config.php
479fc2e phpdoc tuneup from darkdragon. see #5611
ryan authored
477 * @since 2.0.0
75dc778 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
westi authored
478 */
41afea2 Let advanced users override cookies.
matt authored
479 if ( !defined('COOKIE_DOMAIN') )
480 define('COOKIE_DOMAIN', false);
6adcab8 Introduce logged_in cookie. Deliver auth cookies only to wp-admin. s…
ryan authored
481
482 /**
483 * It is possible to define this in wp-config.php
3fc6097 phpdoc corrections from jacobsantos. see #7918
ryan authored
484 * @since 2.6.0
6adcab8 Introduce logged_in cookie. Deliver auth cookies only to wp-admin. s…
ryan authored
485 */
486 if ( !defined('FORCE_SSL_ADMIN') )
487 define('FORCE_SSL_ADMIN', false);
488 force_ssl_admin(FORCE_SSL_ADMIN);
489
490 /**
491 * It is possible to define this in wp-config.php
3fc6097 phpdoc corrections from jacobsantos. see #7918
ryan authored
492 * @since 2.6.0
6adcab8 Introduce logged_in cookie. Deliver auth cookies only to wp-admin. s…
ryan authored
493 */
494 if ( !defined('FORCE_SSL_LOGIN') )
495 define('FORCE_SSL_LOGIN', false);
496 force_ssl_login(FORCE_SSL_LOGIN);
497
6e662d7 Move define of AUTOSAVE_INTERVAL to wp-settings so that it is availab…
ryan authored
498 /**
499 * It is possible to define this in wp-config.php
500 * @since 2.5.0
501 */
502 if ( !defined( 'AUTOSAVE_INTERVAL' ) )
503 define( 'AUTOSAVE_INTERVAL', 60 );
35b18e5 Trailing whitespace cleanup
ryan authored
504
41afea2 Let advanced users override cookies.
matt authored
505
9dc65ab Cleaning up some includes.
saxmatt authored
506 require (ABSPATH . WPINC . '/vars.php');
edc7d7c Installation cleanup.
saxmatt authored
507
c26991b Move hack file include.
saxmatt authored
508 // Check for hacks file if the option is enabled
9f1a7e4 Unset once we have included all the plugins to keep things tidy. Fix…
westi authored
509 if ( get_option('hack_file') ) {
510 if ( file_exists(ABSPATH . 'my-hacks.php') )
764f50b ABSPATH already has a trailing slash. Props Nazgul. fixes #4607
markjaquith authored
511 require(ABSPATH . 'my-hacks.php');
c26991b Move hack file include.
saxmatt authored
512 }
513
c209f15 Don't die with 503 if WP_INSTALLING. Don't load plugins if WP_INSTALL…
ryan authored
514 if ( get_option('active_plugins') && !defined('WP_INSTALLING') ) {
849a0d2 Use get_option instead of get_settings. Just 'cause.
ryan authored
515 $current_plugins = get_option('active_plugins');
11f5bb3 Add a precautionary is_array() check around the plugin loading loop. …
ryan authored
516 if ( is_array($current_plugins) ) {
9f1a7e4 Unset once we have included all the plugins to keep things tidy. Fix…
westi authored
517 foreach ( $current_plugins as $plugin ) {
33ad189 Make the validate_file check more explict and obvious.
westi authored
518 if ( '' != $plugin && 0 == validate_file($plugin) && file_exists(WP_PLUGIN_DIR . '/' . $plugin) )
6c8d35d Allow wp-content to exist outside of webroot. Props sambauers. see #6938
ryan authored
519 include_once(WP_PLUGIN_DIR . '/' . $plugin);
11f5bb3 Add a precautionary is_array() check around the plugin loading loop. …
ryan authored
520 }
9f1a7e4 Unset once we have included all the plugins to keep things tidy. Fix…
westi authored
521 unset($plugin);
e733249 Functional plugin implementation.
saxmatt authored
522 }
523 }
1127059 shutdown action hook.
saxmatt authored
524
c93efa8 Include file renames. #2525
ryan authored
525 require (ABSPATH . WPINC . '/pluggable.php');
08b02d9 Move plugin replacebale functions to pluggable-functions.php. http:/…
ryan authored
526
6e181bb Multi-byte character safe excerpting from nbachiyski. fixes #6077
ryan authored
527 /*
528 * In most cases the default internal encoding is latin1, which is of no use,
529 * since we want to use the mb_ functions for utf-8 strings
530 */
c2c7fa0 Make sure encoding is not empty. Props tenpura. see #6902
ryan authored
531 if (function_exists('mb_internal_encoding')) {
6e80433 Fallback to UTF-8 if not valid mb_internal_encoding. Props tenpura. f…
ryan authored
532 if (!@mb_internal_encoding(get_option('blog_charset')))
c2c7fa0 Make sure encoding is not empty. Props tenpura. see #6902
ryan authored
533 mb_internal_encoding('UTF-8');
534 }
6e181bb Multi-byte character safe excerpting from nbachiyski. fixes #6077
ryan authored
535
536
70a449d Allow for plugins to kick in before everything if define in wp-config
saxmatt authored
537 if ( defined('WP_CACHE') && function_exists('wp_cache_postload') )
538 wp_cache_postload();
539
540 do_action('plugins_loaded');
541
3c8cb2b Revisioning for pages from mdawaffe. see #6775
ryan authored
542 $default_constants = array( 'WP_POST_REVISIONS' => true );
543 foreach ( $default_constants as $c => $v )
544 @define( $c, $v ); // will fail if the constant is already defined
545 unset($default_constants, $c, $v);
546
91efba1 Use wpdb->escape instead of addslashes to prepare DB bound data.
ryan authored
547 // If already slashed, strip.
548 if ( get_magic_quotes_gpc() ) {
6cbb6fe Stripslashes doesn't work on arrays. Add stripslashes_deep(). Props…
ryan authored
549 $_GET = stripslashes_deep($_GET );
550 $_POST = stripslashes_deep($_POST );
551 $_COOKIE = stripslashes_deep($_COOKIE);
65bbec7 Comments refactoring and cleanup
saxmatt authored
552 }
553
91efba1 Use wpdb->escape instead of addslashes to prepare DB bound data.
ryan authored
554 // Escape with wpdb.
555 $_GET = add_magic_quotes($_GET );
556 $_POST = add_magic_quotes($_POST );
557 $_COOKIE = add_magic_quotes($_COOKIE);
558 $_SERVER = add_magic_quotes($_SERVER);
559
1034767 wp_get_current_commenter()
ryan authored
560 do_action('sanitize_comment_cookies');
561
75dc778 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
westi authored
562 /**
563 * WordPress Query object
564 * @global object $wp_the_query
479fc2e phpdoc tuneup from darkdragon. see #5611
ryan authored
565 * @since 2.0.0
75dc778 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
westi authored
566 */
22bee1c Preserve the original query object as wp_the_query so that it's not s…
ryan authored
567 $wp_the_query =& new WP_Query();
75dc778 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
westi authored
568
569 /**
570 * Holds the reference to @see $wp_the_query
571 * Use this global for WordPress queries
572 * @global object $wp_query
479fc2e phpdoc tuneup from darkdragon. see #5611
ryan authored
573 * @since 1.5.0
75dc778 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
westi authored
574 */
22bee1c Preserve the original query object as wp_the_query so that it's not s…
ryan authored
575 $wp_query =& $wp_the_query;
75dc778 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
westi authored
576
577 /**
578 * Holds the WordPress Rewrite object for creating pretty URLs
579 * @global object $wp_rewrite
479fc2e phpdoc tuneup from darkdragon. see #5611
ryan authored
580 * @since 1.5.0
75dc778 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
westi authored
581 */
22bee1c Preserve the original query object as wp_the_query so that it's not s…
ryan authored
582 $wp_rewrite =& new WP_Rewrite();
75dc778 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
westi authored
583
584 /**
585 * WordPress Object
586 * @global object $wp
479fc2e phpdoc tuneup from darkdragon. see #5611
ryan authored
587 * @since 2.0.0
75dc778 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
westi authored
588 */
22bee1c Preserve the original query object as wp_the_query so that it's not s…
ryan authored
589 $wp =& new WP();
1baf503 Break blog header up into functional chunks. Stick it all in a WP cl…
ryan authored
590
bc07ef1 Theme preview and thickbox CSS cleanup. Props azaozz. see #5486
ryan authored
591 do_action('setup_theme');
75dc778 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
westi authored
592
593 /**
594 * Web Path to the current active template directory
3fc6097 phpdoc corrections from jacobsantos. see #7918
ryan authored
595 * @since 1.5.0
75dc778 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
westi authored
596 */
98aa7f5 Rearrange load order. Init classes before loading the text domain an…
ryan authored
597 define('TEMPLATEPATH', get_template_directory());
75dc778 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
westi authored
598
599 /**
600 * Web Path to the current active template stylesheet directory
3fc6097 phpdoc corrections from jacobsantos. see #7918
ryan authored
601 * @since 2.1.0
75dc778 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
westi authored
602 */
b55b6aa Allow stylesheet only themes to provide functions.php. Props skeltoa…
ryan authored
603 define('STYLESHEETPATH', get_stylesheet_directory());
98aa7f5 Rearrange load order. Init classes before loading the text domain an…
ryan authored
604
605 // Load the default text localization domain.
606 load_default_textdomain();
607
479fc2e phpdoc tuneup from darkdragon. see #5611
ryan authored
608 /**
609 * The locale of the blog
610 * @since 1.5.0
611 */
3e26469 Load locale specific php code in global context. fixes #3488
ryan authored
612 $locale = get_locale();
6c8d35d Allow wp-content to exist outside of webroot. Props sambauers. see #6938
ryan authored
613 $locale_file = WP_LANG_DIR . "/$locale.php";
3e26469 Load locale specific php code in global context. fixes #3488
ryan authored
614 if ( is_readable($locale_file) )
615 require_once($locale_file);
616
98aa7f5 Rearrange load order. Init classes before loading the text domain an…
ryan authored
617 // Pull in locale data after loading text domain.
618 require_once(ABSPATH . WPINC . '/locale.php');
619
75dc778 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
westi authored
620 /**
621 * WordPress Locale object for loading locale domain date and various strings.
622 * @global object $wp_locale
479fc2e phpdoc tuneup from darkdragon. see #5611
ryan authored
623 * @since 2.1.0
75dc778 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
westi authored
624 */
92421de Ref more singletons.
ryan authored
625 $wp_locale =& new WP_Locale();
3d2347a WP_Locale. Props Sewar. fixes #2568
ryan authored
626
c369310 Better support for theme plugins. add_theme_page() and active theme …
ryan authored
627 // Load functions for active theme.
b55b6aa Allow stylesheet only themes to provide functions.php. Props skeltoa…
ryan authored
628 if ( TEMPLATEPATH !== STYLESHEETPATH && file_exists(STYLESHEETPATH . '/functions.php') )
629 include(STYLESHEETPATH . '/functions.php');
630 if ( file_exists(TEMPLATEPATH . '/functions.php') )
631 include(TEMPLATEPATH . '/functions.php');
c369310 Better support for theme plugins. add_theme_page() and active theme …
ryan authored
632
75dc778 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
westi authored
633 /**
3fc6097 phpdoc corrections from jacobsantos. see #7918
ryan authored
634 * Runs just before PHP shuts down execution.
75dc778 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
westi authored
635 *
636 * @access private
3fc6097 phpdoc corrections from jacobsantos. see #7918
ryan authored
637 * @since 1.2.0
75dc778 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
westi authored
638 */
98aa7f5 Rearrange load order. Init classes before loading the text domain an…
ryan authored
639 function shutdown_action_hook() {
640 do_action('shutdown');
84da5fc Save cache after the shutdown hook runs. fixes #2232
ryan authored
641 wp_cache_close();
98aa7f5 Rearrange load order. Init classes before loading the text domain an…
ryan authored
642 }
643 register_shutdown_function('shutdown_action_hook');
644
251ad30 Call WP::init() just before kicking the init action so that the curre…
ryan authored
645 $wp->init(); // Sets up current user.
646
1baf503 Break blog header up into functional chunks. Stick it all in a WP cl…
ryan authored
647 // Everything is loaded and initialized.
9838608 Allow multiple args to be passed to apply_filters and do_action. Mov…
rboren authored
648 do_action('init');
06a0fc3 Formatting
matt authored
649
629dde8 Actually check for PHP 4.2. Props nbachiyski. fixes #4336
rob1n authored
650 ?>
Something went wrong with that request. Please try again.