Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 714 lines (614 sloc) 22.563 kb
0bc86133 » mikelittle
2003-06-12 b2config.php replaced with wp-config.sample.php
1 <?php
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
2 /**
3 * Used to setup and fix common variables and include
4 * the WordPress procedural and class library.
5 *
479fc2e2 » ryan
2008-01-09 phpdoc tuneup from darkdragon. see #5611
6 * You should not have to change this file and allows
7 * for some configuration in wp-config.php.
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
8 *
9 * @package WordPress
10 */
11
5c2f29c4 » ryan
2008-01-29 Increase memory limit. Props darkdragon. see #3141
12 if ( !defined('WP_MEMORY_LIMIT') )
13 define('WP_MEMORY_LIMIT', '32M');
14
a5246f53 » ryan
2008-01-29 absint is not defined yet. see #4762
15 if ( function_exists('memory_get_usage') && ( (int) @ini_get('memory_limit') < abs(intval(WP_MEMORY_LIMIT)) ) )
5c2f29c4 » ryan
2008-01-29 Increase memory limit. Props darkdragon. see #3141
16 @ini_set('memory_limit', WP_MEMORY_LIMIT);
17
8b349590 » ryan
2008-12-31 Turn off magic_quotes_sybase. It prevents addslashes from escaping ba…
18 set_magic_quotes_runtime(0);
19 @ini_set('magic_quotes_sybase', 0);
6e181bb9 » ryan
2008-03-03 Multi-byte character safe excerpting from nbachiyski. fixes #6077
20
23710436 » ryan
2009-12-02 Set default timezone. Props Denis-de-Bernardy. fixes #10940
21 if ( function_exists('date_default_timezone_set') )
22 date_default_timezone_set('UTC');
23
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
24 /**
3fc6097a » ryan
2008-10-18 phpdoc corrections from jacobsantos. see #7918
25 * Turn register globals off.
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
26 *
27 * @access private
479fc2e2 » ryan
2008-01-09 phpdoc tuneup from darkdragon. see #5611
28 * @since 2.1.0
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
29 * @return null Will return null if register_globals PHP directive was disabled
30 */
d4f95b7f » rob1n
2007-06-12 Accidental commit. Props Nazgul. fixes #4437
31 function wp_unregister_GLOBALS() {
32 if ( !ini_get('register_globals') )
33 return;
dce5220c » matt
2005-08-15 Typos and more secure unsetting. Hat tip: Stefen Esser
34
d4f95b7f » rob1n
2007-06-12 Accidental commit. Props Nazgul. fixes #4437
35 if ( isset($_REQUEST['GLOBALS']) )
36 die('GLOBALS overwrite attempt detected');
37
38 // Variables that shouldn't be unset
39 $noUnset = array('GLOBALS', '_GET', '_POST', '_COOKIE', '_REQUEST', '_SERVER', '_ENV', '_FILES', 'table_prefix');
40
41 $input = array_merge($_GET, $_POST, $_COOKIE, $_SERVER, $_ENV, $_FILES, isset($_SESSION) && is_array($_SESSION) ? $_SESSION : array());
321c3107 » ryan
2007-09-03 Remove trailing whitespace
42 foreach ( $input as $k => $v )
d4f95b7f » rob1n
2007-06-12 Accidental commit. Props Nazgul. fixes #4437
43 if ( !in_array($k, $noUnset) && isset($GLOBALS[$k]) ) {
9323d394 » ryan
2007-01-11 Zend hash del key or index fix. PRops MarkJaquith.
44 $GLOBALS[$k] = NULL;
d4f95b7f » rob1n
2007-06-12 Accidental commit. Props Nazgul. fixes #4437
45 unset($GLOBALS[$k]);
9323d394 » ryan
2007-01-11 Zend hash del key or index fix. PRops MarkJaquith.
46 }
2919fe29 » matt
2005-08-09 That last thing didn't work at all.
47 }
877e6a71 » matt
2005-08-09 Turn register globals off. Hat tip: Christian Schmidt
48
321c3107 » ryan
2007-09-03 Remove trailing whitespace
49 wp_unregister_GLOBALS();
d4f95b7f » rob1n
2007-06-12 Accidental commit. Props Nazgul. fixes #4437
50
479fc2e2 » ryan
2008-01-09 phpdoc tuneup from darkdragon. see #5611
51 unset( $wp_filter, $cache_lastcommentmodified, $cache_lastpostdate );
376ec4dc » matt
2005-08-09 Tweak
52
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
53 /**
54 * The $blog_id global, which you can change in the config allows you to create a simple
55 * multiple blog installation using just one WordPress and changing $blog_id around.
56 *
57 * @global int $blog_id
479fc2e2 » ryan
2008-01-09 phpdoc tuneup from darkdragon. see #5611
58 * @since 2.0.0
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
59 */
d4f95b7f » rob1n
2007-06-12 Accidental commit. Props Nazgul. fixes #4437
60 if ( ! isset($blog_id) )
85723b89 » ryan
2005-11-07 Object caching, round one.
61 $blog_id = 1;
62
044d460b » azaozz
2009-06-28 Improved $_SERVER['REQUEST_URI'] test for IIS, props ruslany, fixes #…
63 // Fix for IIS when running with PHP ISAPI
64 if ( empty( $_SERVER['REQUEST_URI'] ) || ( php_sapi_name() != 'cgi-fcgi' && preg_match( '/^Microsoft-IIS\//', $_SERVER['SERVER_SOFTWARE'] ) ) ) {
dd202ce1 » ryan
2006-02-12 Death to trailing tabs. Props Mark J. fixes #2405
65
54639a39 » markjaquith
2007-08-17 Set REQUEST_URI for IIS in more situations. props snakefoot. fixes #3514
66 // IIS Mod-Rewrite
67 if (isset($_SERVER['HTTP_X_ORIGINAL_URL'])) {
68 $_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_ORIGINAL_URL'];
69 }
70 // IIS Isapi_Rewrite
71 else if (isset($_SERVER['HTTP_X_REWRITE_URL'])) {
72 $_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_REWRITE_URL'];
73 }
c698c971 » markjaquith
2007-10-09 IIS REQUEST_URI-setting fixes from snakefoot. fixes #5160 for trunk
74 else
75 {
a3a1f83d » ryan
2008-07-28 Use ORIG_PATH_INFO if PATH_INFO is not available. fixes #7058 for trunk
76 // Use ORIG_PATH_INFO if there is no PATH_INFO
77 if ( !isset($_SERVER['PATH_INFO']) && isset($_SERVER['ORIG_PATH_INFO']) )
78 $_SERVER['PATH_INFO'] = $_SERVER['ORIG_PATH_INFO'];
79
c698c971 » markjaquith
2007-10-09 IIS REQUEST_URI-setting fixes from snakefoot. fixes #5160 for trunk
80 // Some IIS + PHP configurations puts the script-name in the path-info (No need to append it twice)
8d6d1af3 » ryan
2008-04-21 Check if PATH_INFO is set to avoid undefined index errors. see #5160
81 if ( isset($_SERVER['PATH_INFO']) ) {
82 if ( $_SERVER['PATH_INFO'] == $_SERVER['SCRIPT_NAME'] )
83 $_SERVER['REQUEST_URI'] = $_SERVER['PATH_INFO'];
84 else
85 $_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'] . $_SERVER['PATH_INFO'];
86 }
87c4f3a1 » ryan
2007-09-03 Strip lines that contain only whitespace down to newlines.
87
54639a39 » markjaquith
2007-08-17 Set REQUEST_URI for IIS in more situations. props snakefoot. fixes #3514
88 // Append the query string if it exists and isn't null
89 if (isset($_SERVER['QUERY_STRING']) && !empty($_SERVER['QUERY_STRING'])) {
90 $_SERVER['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
91 }
720316dd » rboren
2004-10-26 Do not touch REQUEST_URI if it is already set by the server.
92 }
12b40694 » rboren
2004-10-22 Fix REQUEST_URI construction for IIS. Bug 389. Patch from Dennis Will…
93 }
a18a23e8 » saxmatt
2004-02-10 Work around IIS' lack of REQUEST_URI
94
c50e7da2 » matt
2005-11-10 Fixes #1591 (again)
95 // Fix for PHP as CGI hosts that set SCRIPT_FILENAME to something ending in php.cgi for all requests
c1ed565c » ryan
2006-01-06 Check if SCRIPT_FILENAME is set to avoid warnings. fixes #2227
96 if ( isset($_SERVER['SCRIPT_FILENAME']) && ( strpos($_SERVER['SCRIPT_FILENAME'], 'php.cgi') == strlen($_SERVER['SCRIPT_FILENAME']) - 7 ) )
c50e7da2 » matt
2005-11-10 Fixes #1591 (again)
97 $_SERVER['SCRIPT_FILENAME'] = $_SERVER['PATH_TRANSLATED'];
98
885ee8f9 » matt
2005-11-14 This should fix permalinks, but may break the PHP as CGI funkiness again
99 // Fix for Dreamhost and other PHP as CGI hosts
3320dd13 » markjaquith
2007-03-07 Use strpos instead of strstr where ever possible, for speed. Props ro…
100 if (strpos($_SERVER['SCRIPT_NAME'], 'php.cgi') !== false)
c50e7da2 » matt
2005-11-10 Fixes #1591 (again)
101 unset($_SERVER['PATH_INFO']);
102
38f4fca0 » ryan
2005-12-29 Move PHP_SELF setup to wp-settings.php. #2153
103 // Fix empty PHP_SELF
104 $PHP_SELF = $_SERVER['PHP_SELF'];
105 if ( empty($PHP_SELF) )
106 $_SERVER['PHP_SELF'] = $PHP_SELF = preg_replace("/(\?.*)?$/",'',$_SERVER["REQUEST_URI"]);
885ee8f9 » matt
2005-11-14 This should fix permalinks, but may break the PHP as CGI funkiness again
107
f3d0aaee » ryan
2008-01-25 Require PHP 4.3
108 if ( version_compare( '4.3', phpversion(), '>' ) ) {
e1226189 » azaozz
2008-08-29 Fix typo in wp-settings.php. Props mictasm, fixes #7638
109 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() ) );
629dde86 » rob1n
2007-05-25 Actually check for PHP 4.2. Props nbachiyski. fixes #4336
110 }
da4a0d98 » saxmatt
2004-08-10 Fix for empty plugin strings, class include moved for timing.
111
6c8d35de » ryan
2008-05-27 Allow wp-content to exist outside of webroot. Props sambauers. see #6938
112 if ( !defined('WP_CONTENT_DIR') )
113 define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' ); // no trailing slash, full paths only - WP_CONTENT_URL is defined further down
114
c209f15b » ryan
2008-10-05 Don't die with 503 if WP_INSTALLING. Don't load plugins if WP_INSTALL…
115 if ( file_exists(ABSPATH . '.maintenance') && !defined('WP_INSTALLING') ) {
d7fccb66 » ryan
2008-10-14 Sanitation and error handling for plugin install. Props DD32. see #6015
116 include(ABSPATH . '.maintenance');
117 // If the $upgrading timestamp is older than 10 minutes, don't die.
118 if ( ( time() - $upgrading ) < 600 ) {
119 if ( file_exists( WP_CONTENT_DIR . '/maintenance.php' ) ) {
120 require_once( WP_CONTENT_DIR . '/maintenance.php' );
121 die();
122 }
05305465 » ryan
2008-08-08 Automatic upgrade, first cut. see #5560
123
d7fccb66 » ryan
2008-10-14 Sanitation and error handling for plugin install. Props DD32. see #6015
124 $protocol = $_SERVER["SERVER_PROTOCOL"];
125 if ( 'HTTP/1.1' != $protocol && 'HTTP/1.0' != $protocol )
126 $protocol = 'HTTP/1.0';
127 header( "$protocol 503 Service Unavailable", true, 503 );
128 header( 'Content-Type: text/html; charset=utf-8' );
cd03493d » azaozz
2009-08-15 Send Retry-After header when in maintenance mode, props sirzooro, fix…
129 header( 'Retry-After: 600' );
05305465 » ryan
2008-08-08 Automatic upgrade, first cut. see #5560
130 ?>
131 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
132 <html xmlns="http://www.w3.org/1999/xhtml">
133 <head>
134 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
135 <title>Maintenance</title>
136
137 </head>
138 <body>
139 <h1>Briefly unavailable for scheduled maintenance. Check back in a minute.</h1>
140 </body>
141 </html>
142 <?php
d7fccb66 » ryan
2008-10-14 Sanitation and error handling for plugin install. Props DD32. see #6015
143 die();
144 }
05305465 » ryan
2008-08-08 Automatic upgrade, first cut. see #5560
145 }
146
6c8d35de » ryan
2008-05-27 Allow wp-content to exist outside of webroot. Props sambauers. see #6938
147 if ( !extension_loaded('mysql') && !file_exists(WP_CONTENT_DIR . '/db.php') )
f42b96cd » ryan
2008-06-23 Mark string that cannot be gettexted. Props nbachiyski. fixes #7074
148 die( /*WP_I18N_OLD_MYSQL*/'Your PHP installation appears to be missing the MySQL extension which is required by WordPress.'/*/WP_I18N_OLD_MYSQL*/ );
0d040b30 » saxmatt
2004-12-14 Sanity check mysql.
149
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
150 /**
3fc6097a » ryan
2008-10-18 phpdoc corrections from jacobsantos. see #7918
151 * PHP 4 standard microtime start capture.
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
152 *
153 * @access private
479fc2e2 » ryan
2008-01-09 phpdoc tuneup from darkdragon. see #5611
154 * @since 0.71
3fc6097a » ryan
2008-10-18 phpdoc corrections from jacobsantos. see #7918
155 * @global int $timestart Seconds and Microseconds added together from when function is called.
156 * @return bool Always returns true.
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
157 */
551e52ff » saxmatt
2004-10-04 Code cleanup and some fixes from the WP Japan folks.
158 function timer_start() {
159 global $timestart;
160 $mtime = explode(' ', microtime() );
161 $mtime = $mtime[1] + $mtime[0];
162 $timestart = $mtime;
163 return true;
164 }
0f7bb42a » ryan
2006-09-07 timer_stop() wanted to be near timer_start().
165
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
166 /**
3fc6097a » ryan
2008-10-18 phpdoc corrections from jacobsantos. see #7918
167 * Return and/or display the time from the page start to when function is called.
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
168 *
169 * You can get the results and print them by doing:
170 * <code>
171 * $nTimePageTookToExecute = timer_stop();
172 * echo $nTimePageTookToExecute;
173 * </code>
174 *
175 * Or instead, you can do:
176 * <code>
177 * timer_stop(1);
178 * </code>
179 * which will do what the above does. If you need the result, you can assign it to a variable, but
180 * most cases, you only need to echo it.
181 *
6950e283 » westi
2007-12-20 Fix @since for timer_start and timer_stop. See #5211.
182 * @since 0.71
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
183 * @global int $timestart Seconds and Microseconds added together from when timer_start() is called
184 * @global int $timeend Seconds and Microseconds added together from when function is called
185 *
186 * @param int $display Use '0' or null to not echo anything and 1 to echo the total time
187 * @param int $precision The amount of digits from the right of the decimal to display. Default is 3.
188 * @return float The "second.microsecond" finished time calculation
189 */
0f7bb42a » ryan
2006-09-07 timer_stop() wanted to be near timer_start().
190 function timer_stop($display = 0, $precision = 3) { //if called like timer_stop(1), will echo $timetotal
191 global $timestart, $timeend;
192 $mtime = microtime();
193 $mtime = explode(' ',$mtime);
194 $mtime = $mtime[1] + $mtime[0];
195 $timeend = $mtime;
196 $timetotal = $timeend-$timestart;
4f6b825b » markjaquith
2007-09-19 Make sure number_format_i18n() is available before calling it in time…
197 $r = ( function_exists('number_format_i18n') ) ? number_format_i18n($timetotal, $precision) : number_format($timetotal, $precision);
0f7bb42a » ryan
2006-09-07 timer_stop() wanted to be near timer_start().
198 if ( $display )
a9d23d40 » markjaquith
2006-10-04 allow timer_stop() to use number_format() when returning. Props mdawa…
199 echo $r;
200 return $r;
0f7bb42a » ryan
2006-09-07 timer_stop() wanted to be near timer_start().
201 }
551e52ff » saxmatt
2004-10-04 Code cleanup and some fixes from the WP Japan folks.
202 timer_start();
da4a0d98 » saxmatt
2004-08-10 Fix for empty plugin strings, class include moved for timing.
203
f3e26c6d » westi
2007-10-02 s/WPDEBUG/WP_DEBUG/g Fixes #5033
204 // Add define('WP_DEBUG',true); to wp-config.php to enable display of notices during development.
cdcb8060 » westi
2009-07-09 Add extra site debugging support to enable conditionally enable displ…
205 if ( defined('WP_DEBUG') && WP_DEBUG == true ) {
479fc2e2 » ryan
2008-01-09 phpdoc tuneup from darkdragon. see #5611
206 error_reporting(E_ALL);
cdcb8060 » westi
2009-07-09 Add extra site debugging support to enable conditionally enable displ…
207 // Add define('WP_DEBUG_DISPLAY', false); to wp-config.php to use the globally configured setting for display_errors and not force it to On
208 if ( ! defined('WP_DEBUG_DISPLAY') || WP_DEBUG_DISPLAY == true )
209 ini_set('display_errors', 1);
210 // Add define('WP_DEBUG_LOG', true); to enable php debug logging to WP_CONTENT_DIR/debug.log
211 if ( defined('WP_DEBUG_LOG') && WP_DEBUG_LOG == true ) {
212 ini_set('log_errors', 1);
213 ini_set('error_log', WP_CONTENT_DIR . '/debug.log');
214 }
2bcddfc0 » westi
2007-09-30 Enable developers to turn on notices from wp-config.php. Relates #315…
215 } else {
e7941d79 » westi
2009-11-18 Ensure WP_DEBUG is always defined and simplify the checks on it. Fixe…
216 define('WP_DEBUG', false);
ee0bfee6 » ryan
2009-04-29 Error reporting fixes. Props Denis-de-Bernardy, jacobsantos. fixes #9…
217 if ( defined('E_RECOVERABLE_ERROR') )
218 error_reporting(E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR);
0c9e106c » westi
2009-01-22 Update error_reporting configuration for newer version of PHP. Fixes …
219 else
ee0bfee6 » ryan
2009-04-29 Error reporting fixes. Props Denis-de-Bernardy, jacobsantos. fixes #9…
220 error_reporting(E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING);
2bcddfc0 » westi
2007-09-30 Enable developers to turn on notices from wp-config.php. Relates #315…
221 }
9b09572d » saxmatt
2004-01-02 Turn down error reporting.
222
70a449d8 » saxmatt
2005-02-15 Allow for plugins to kick in before everything if define in wp-config
223 // For an advanced caching plugin to use, static because you would only want one
a2c12cb6 » ryan
2009-11-16 Make sure WP_CACHE is true. Props nacin. fixes #10602
224 if ( defined('WP_CACHE') && WP_CACHE )
6c8d35de » ryan
2008-05-27 Allow wp-content to exist outside of webroot. Props sambauers. see #6938
225 @include WP_CONTENT_DIR . '/advanced-cache.php';
70a449d8 » saxmatt
2005-02-15 Allow for plugins to kick in before everything if define in wp-config
226
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
227 /**
228 * Stores the location of the WordPress directory of functions, classes, and core content.
229 *
479fc2e2 » ryan
2008-01-09 phpdoc tuneup from darkdragon. see #5611
230 * @since 1.0.0
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
231 */
edc7d7cd » saxmatt
2003-12-31 Installation cleanup.
232 define('WPINC', 'wp-includes');
54d7ccba » markjaquith
2006-11-04 make /languages/ directory default to /wp-content/languages/ with fal…
233
a5d93553 » azaozz
2008-08-06 Revert 8562 (last was incorrect)
234 if ( !defined('WP_LANG_DIR') ) {
235 /**
236 * Stores the location of the language directory. First looks for language folder in WP_CONTENT_DIR
237 * and uses that folder if it exists. Or it uses the "languages" folder in WPINC.
238 *
239 * @since 2.1.0
0c6394a0 » azaozz
2008-08-05 Stop fatal error in post revisions when setting the include path is d…
240 */
a5d93553 » azaozz
2008-08-06 Revert 8562 (last was incorrect)
241 if ( file_exists(WP_CONTENT_DIR . '/languages') && @is_dir(WP_CONTENT_DIR . '/languages') ) {
242 define('WP_LANG_DIR', WP_CONTENT_DIR . '/languages'); // no leading slash, no trailing slash, full path, not relative to ABSPATH
243 if (!defined('LANGDIR')) {
244 // Old static relative path maintained for limited backwards compatibility - won't work in some cases
245 define('LANGDIR', 'wp-content/languages');
246 }
247 } else {
248 define('WP_LANG_DIR', ABSPATH . WPINC . '/languages'); // no leading slash, no trailing slash, full path, not relative to ABSPATH
249 if (!defined('LANGDIR')) {
250 // Old relative path maintained for backwards compatibility
251 define('LANGDIR', WPINC . '/languages');
252 }
253 }
0c6394a0 » azaozz
2008-08-05 Stop fatal error in post revisions when setting the include path is d…
254 }
255
b36471d4 » markjaquith
2007-09-13 Use wp_die() for WPDB bails. Send 500 response and no-cache headers s…
256 require (ABSPATH . WPINC . '/compat.php');
257 require (ABSPATH . WPINC . '/functions.php');
1d0bf72d » ryan
2007-10-31 AJAX for link category add and delete. Props mdawaffe. fixes #5291
258 require (ABSPATH . WPINC . '/classes.php');
b36471d4 » markjaquith
2007-09-13 Use wp_die() for WPDB bails. Send 500 response and no-cache headers s…
259
658d22d0 » ryan
2009-04-10 Store field types in wpdb object. Props mdawaffe. see #7171
260 require_wp_db();
261
262 if ( !empty($wpdb->error) )
263 dead_db();
264
cb712c99 » ryan
2009-03-06 Only list field types that are not strings. see #7171
265 /**
266 * Format specifiers for DB columns. Columns not listed here default to %s.
267 * @since 2.8.0
658d22d0 » ryan
2009-04-10 Store field types in wpdb object. Props mdawaffe. see #7171
268 * @see wpdb:$field_types
269 * @see wpdb:prepare()
270 * @see wpdb:insert()
271 * @see wpdb:update()
cb712c99 » ryan
2009-03-06 Only list field types that are not strings. see #7171
272 */
658d22d0 » ryan
2009-04-10 Store field types in wpdb object. Props mdawaffe. see #7171
273 $wpdb->field_types = array( 'post_author' => '%d', 'post_parent' => '%d', 'menu_order' => '%d', 'term_id' => '%d', 'term_group' => '%d', 'term_taxonomy_id' => '%d',
cb712c99 » ryan
2009-03-06 Only list field types that are not strings. see #7171
274 'parent' => '%d', 'count' => '%d','object_id' => '%d', 'term_order' => '%d', 'ID' => '%d', 'commment_ID' => '%d', 'comment_post_ID' => '%d', 'comment_parent' => '%d',
275 'user_id' => '%d', 'link_id' => '%d', 'link_owner' => '%d', 'link_rating' => '%d', 'option_id' => '%d', 'blog_id' => '%d', 'meta_id' => '%d', 'post_id' => '%d',
c1886783 » ryan
2009-03-06 Use wpdb::insert() and update(). see #6836
276 'user_status' => '%d', 'umeta_id' => '%d', 'comment_karma' => '%d', 'comment_count' => '%d');
d6ee6062 » ryan
2009-03-06 Add some default field types. see #7171
277
1d0bf72d » ryan
2007-10-31 AJAX for link category add and delete. Props mdawaffe. fixes #5291
278 $prefix = $wpdb->set_prefix($table_prefix);
71a2674b » markjaquith
2006-12-15 Use $wpdb->prefix when defining table names
279
1d0bf72d » ryan
2007-10-31 AJAX for link category add and delete. Props mdawaffe. fixes #5291
280 if ( is_wp_error($prefix) )
f42b96cd » ryan
2008-06-23 Mark string that cannot be gettexted. Props nbachiyski. fixes #7074
281 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*/);
cde68f93 » markjaquith
2007-01-07 Exit gracefully with a warning if the table_prefix uses disallowed ch…
282
d2110af1 » ryan
2009-04-15 Define wp_clone() before loading the cache.
283 /**
284 * Copy an object.
285 *
286 * Returns a cloned copy of an object.
287 *
288 * @since 2.7.0
289 *
290 * @param object $object The object to clone
291 * @return object The cloned object
292 */
293 function wp_clone( $object ) {
294 static $can_clone;
295 if ( !isset( $can_clone ) ) {
296 $can_clone = version_compare( phpversion(), '5.0', '>=' );
297 }
298 return $can_clone ? clone( $object ) : $object;
299 }
300
f1d33505 » ryan
2009-02-05 Flag if using external object cache. see #9048
301 if ( file_exists(WP_CONTENT_DIR . '/object-cache.php') ) {
6c8d35de » ryan
2008-05-27 Allow wp-content to exist outside of webroot. Props sambauers. see #6938
302 require_once (WP_CONTENT_DIR . '/object-cache.php');
f1d33505 » ryan
2009-02-05 Flag if using external object cache. see #9048
303 $_wp_using_ext_object_cache = true;
304 } else {
b3d3d731 » rob1n
2007-04-25 Require once only. Props masquerade. fixes #4192
305 require_once (ABSPATH . WPINC . '/cache.php');
f1d33505 » ryan
2009-02-05 Flag if using external object cache. see #9048
306 $_wp_using_ext_object_cache = false;
307 }
85723b89 » ryan
2005-11-07 Object caching, round one.
308
309 wp_cache_init();
58e47dcb » ryan
2008-05-22 wp_cache_add_global_groups() and wp_cache_add_non_persistent_groups()…
310 if ( function_exists('wp_cache_add_global_groups') ) {
9ee06eae » ryan
2009-10-29 Introduce get/set/delete_site_transient(). Make theme_roots a site tr…
311 wp_cache_add_global_groups(array ('users', 'userlogins', 'usermeta', 'site-transient'));
b666a1c9 » ryan
2008-06-10 Cache get_plugins() list. Props DD32. fixes #7113
312 wp_cache_add_non_persistent_groups(array( 'comment', 'counts', 'plugins' ));
58e47dcb » ryan
2008-05-22 wp_cache_add_global_groups() and wp_cache_add_non_persistent_groups()…
313 }
85723b89 » ryan
2005-11-07 Object caching, round one.
314
6d7717e1 » ryan
2006-06-20 Move plugin API to plugin.php. #2525
315 require (ABSPATH . WPINC . '/plugin.php');
81e7d921 » saxmatt
2005-02-07 Some filter action and cleanup
316 require (ABSPATH . WPINC . '/default-filters.php');
5dfddd7b » ryan
2009-02-17 Switch to pomo lib. Support gettext contexts. Deprecate long form fun…
317 include_once(ABSPATH . WPINC . '/pomo/mo.php');
62927ab6 » ryan
2006-06-15 Remove wp- prefix from wp-l10n.php
318 require_once (ABSPATH . WPINC . '/l10n.php');
1bd4057b » saxmatt
2004-12-19 Bug fixes
319
3320dd13 » markjaquith
2007-03-07 Use strpos instead of strstr where ever possible, for speed. Props ro…
320 if ( !is_blog_installed() && (strpos($_SERVER['PHP_SELF'], 'install.php') === false && !defined('WP_INSTALLING')) ) {
25abcd13 » markjaquith
2007-08-03 More streamlined install process. Obeys WP_SITEURL if defined. fixes …
321 if ( defined('WP_SITEURL') )
321c3107 » ryan
2007-09-03 Remove trailing whitespace
322 $link = WP_SITEURL . '/wp-admin/install.php';
25abcd13 » markjaquith
2007-08-03 More streamlined install process. Obeys WP_SITEURL if defined. fixes …
323 elseif (strpos($_SERVER['PHP_SELF'], 'wp-admin') !== false)
324 $link = preg_replace('|/wp-admin/?.*?$|', '/', $_SERVER['PHP_SELF']) . 'wp-admin/install.php';
ca2815fb » saxmatt
2005-01-31 If we're already in wp-admin don't recursive link
325 else
25abcd13 » markjaquith
2007-08-03 More streamlined install process. Obeys WP_SITEURL if defined. fixes …
326 $link = preg_replace('|/[^/]+?$|', '/', $_SERVER['PHP_SELF']) . 'wp-admin/install.php';
327 require_once(ABSPATH . WPINC . '/kses.php');
328 require_once(ABSPATH . WPINC . '/pluggable.php');
090bee02 » ryan
2009-06-22 Load formatting.php before install redirect so that wp_redirect() can…
329 require_once(ABSPATH . WPINC . '/formatting.php');
25abcd13 » markjaquith
2007-08-03 More streamlined install process. Obeys WP_SITEURL if defined. fixes …
330 wp_redirect($link);
331 die(); // have to die here ~ Mark
ca2815fb » saxmatt
2005-01-31 If we're already in wp-admin don't recursive link
332 }
1bd4057b » saxmatt
2004-12-19 Bug fixes
333
c93efa86 » ryan
2006-06-11 Include file renames. #2525
334 require (ABSPATH . WPINC . '/formatting.php');
a6ade4a7 » ryan
2005-07-11 Role/capability system. Round one. Props: Owen Winkler
335 require (ABSPATH . WPINC . '/capabilities.php');
9303053d » ryan
2006-03-13 Move WP_Query and its wrapper functions to query.php. #2525
336 require (ABSPATH . WPINC . '/query.php');
40b2e610 » ryan
2006-04-18 Move theme functions to theme.php. #2525
337 require (ABSPATH . WPINC . '/theme.php');
c56e62f5 » ryan
2006-06-08 Move user functions to user.php. Relocate more post functions to post…
338 require (ABSPATH . WPINC . '/user.php');
c67e70dd » westi
2009-09-17 First pass commentmeta implementation. See #2659 props scribu.
339 require (ABSPATH . WPINC . '/meta.php');
c93efa86 » ryan
2006-06-11 Include file renames. #2525
340 require (ABSPATH . WPINC . '/general-template.php');
341 require (ABSPATH . WPINC . '/link-template.php');
c56e62f5 » ryan
2006-06-08 Move user functions to user.php. Relocate more post functions to post…
342 require (ABSPATH . WPINC . '/author-template.php');
3c8ed766 » ryan
2006-06-07 Reworg post/page/attachment functions. #2525
343 require (ABSPATH . WPINC . '/post.php');
344 require (ABSPATH . WPINC . '/post-template.php');
0f5dc0f0 » ryan
2006-06-04 Reorg category functions. #2525
345 require (ABSPATH . WPINC . '/category.php');
346 require (ABSPATH . WPINC . '/category-template.php');
6027cfa9 » ryan
2006-04-19 Reorg comment functions. #2525
347 require (ABSPATH . WPINC . '/comment.php');
348 require (ABSPATH . WPINC . '/comment-template.php');
6970a75e » ryan
2006-03-12 Rewrite API additions and improvements from David House. #2433
349 require (ABSPATH . WPINC . '/rewrite.php');
c93efa86 » ryan
2006-06-11 Include file renames. #2525
350 require (ABSPATH . WPINC . '/feed.php');
19ea5fb7 » ryan
2006-06-05 Reorg bookmark functions. #2525
351 require (ABSPATH . WPINC . '/bookmark.php');
352 require (ABSPATH . WPINC . '/bookmark-template.php');
9dc65ab2 » saxmatt
2004-04-27 Cleaning up some includes.
353 require (ABSPATH . WPINC . '/kses.php');
fb1e5310 » ryan
2006-03-07 Cron improvements from masquerade. #2425
354 require (ABSPATH . WPINC . '/cron.php');
2520d8e8 » saxmatt
2005-02-07 Include cleanups
355 require (ABSPATH . WPINC . '/version.php');
ca92bb43 » ryan
2006-03-02 Move deprecated functions to deprecated.php. #2520
356 require (ABSPATH . WPINC . '/deprecated.php');
4d49e98f » ryan
2006-05-22 Script loader from mdawaffe. #2701
357 require (ABSPATH . WPINC . '/script-loader.php');
634a33c2 » ryan
2007-05-22 Very rough initial commit of taxonomy for everyone's hacking pleasure…
358 require (ABSPATH . WPINC . '/taxonomy.php');
7c2dbb9c » matt
2007-08-17 First pass at upgrade notification for core, see #1476. Also includes…
359 require (ABSPATH . WPINC . '/update.php');
6fc031de » markjaquith
2007-08-17 Canonical URLs, first swing. Props to Scott Yang, Ryan and Matt. see …
360 require (ABSPATH . WPINC . '/canonical.php');
f5291230 » matt
2008-01-25 First pass at async upload, multi-upload, and gallery feature. Modifi…
361 require (ABSPATH . WPINC . '/shortcodes.php');
833447d5 » ryan
2008-02-21 Image size options from tellyworth. fixes #5933
362 require (ABSPATH . WPINC . '/media.php');
3c99cfc4 » ryan
2008-08-01 HTTP POST and REQUEST API from jacobsantos. see #4779
363 require (ABSPATH . WPINC . '/http.php');
48000c92 » ryan
2009-03-16 Separate default widgets from widgets API. Always load API. fixes #9349
364 require (ABSPATH . WPINC . '/widgets.php');
da4a0d98 » saxmatt
2004-08-10 Fix for empty plugin strings, class include moved for timing.
365
6c8d35de » ryan
2008-05-27 Allow wp-content to exist outside of webroot. Props sambauers. see #6938
366 if ( !defined('WP_CONTENT_URL') )
995fe002 » ryan
2008-05-28 Use siteurl instead of home. Props msi08. fixes #7050
367 define( 'WP_CONTENT_URL', get_option('siteurl') . '/wp-content'); // full url - WP_CONTENT_DIR is defined further up
6c8d35de » ryan
2008-05-27 Allow wp-content to exist outside of webroot. Props sambauers. see #6938
368
369 /**
370 * Allows for the plugins directory to be moved from the default location.
371 *
3fc6097a » ryan
2008-10-18 phpdoc corrections from jacobsantos. see #7918
372 * @since 2.6.0
6c8d35de » ryan
2008-05-27 Allow wp-content to exist outside of webroot. Props sambauers. see #6938
373 */
374 if ( !defined('WP_PLUGIN_DIR') )
375 define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins' ); // full path, no trailing slash
3fc6097a » ryan
2008-10-18 phpdoc corrections from jacobsantos. see #7918
376
377 /**
378 * Allows for the plugins directory to be moved from the default location.
379 *
380 * @since 2.6.0
381 */
6c8d35de » ryan
2008-05-27 Allow wp-content to exist outside of webroot. Props sambauers. see #6938
382 if ( !defined('WP_PLUGIN_URL') )
383 define( 'WP_PLUGIN_URL', WP_CONTENT_URL . '/plugins' ); // full url, no trailing slash
3fc6097a » ryan
2008-10-18 phpdoc corrections from jacobsantos. see #7918
384
385 /**
386 * Allows for the plugins directory to be moved from the default location.
387 *
388 * @since 2.1.0
389 */
6c8d35de » ryan
2008-05-27 Allow wp-content to exist outside of webroot. Props sambauers. see #6938
390 if ( !defined('PLUGINDIR') )
391 define( 'PLUGINDIR', 'wp-content/plugins' ); // Relative to ABSPATH. For back compat.
392
545da159 » ryan
2008-11-10 Notice fixes from DD32. see #7509
393 /**
3bf4ed17 » ryan
2009-03-07 Support mu-plugins for 'Must Use' autoload plugins
394 * Allows for the mu-plugins directory to be moved from the default location.
395 *
396 * @since 2.8.0
397 */
398 if ( !defined('WPMU_PLUGIN_DIR') )
399 define( 'WPMU_PLUGIN_DIR', WP_CONTENT_DIR . '/mu-plugins' ); // full path, no trailing slash
400
401 /**
402 * Allows for the mu-plugins directory to be moved from the default location.
403 *
404 * @since 2.8.0
405 */
406 if ( !defined('WPMU_PLUGIN_URL') )
407 define( 'WPMU_PLUGIN_URL', WP_CONTENT_URL . '/mu-plugins' ); // full url, no trailing slash
408
409 /**
410 * Allows for the mu-plugins directory to be moved from the default location.
411 *
412 * @since 2.8.0
413 */
e8b6fe73 » ryan
2009-03-18 Trim trailing whitespace
414 if ( !defined( 'MUPLUGINDIR' ) )
3bf4ed17 » ryan
2009-03-07 Support mu-plugins for 'Must Use' autoload plugins
415 define( 'MUPLUGINDIR', 'wp-content/mu-plugins' ); // Relative to ABSPATH. For back compat.
416
417 if ( is_dir( WPMU_PLUGIN_DIR ) ) {
418 if ( $dh = opendir( WPMU_PLUGIN_DIR ) ) {
419 while ( ( $plugin = readdir( $dh ) ) !== false ) {
420 if ( substr( $plugin, -4 ) == '.php' ) {
421 include_once( WPMU_PLUGIN_DIR . '/' . $plugin );
422 }
423 }
424 }
425 }
426 do_action('muplugins_loaded');
427
428 /**
545da159 » ryan
2008-11-10 Notice fixes from DD32. see #7509
429 * Used to guarantee unique hash cookies
430 * @since 1.5
431 */
432 define('COOKIEHASH', md5(get_option('siteurl')));
5c97b54c » saxmatt
2003-12-15 Smilie fix from Jaykul, changed fool's siteurl fix to use faster preg…
433
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
434 /**
54f091ee » ryan
2008-02-22 Allow overriding the default secret key. Proy. Props nbachiyski. fixe…
435 * Should be exactly the same as the default value of SECRET_KEY in wp-config-sample.php
3fc6097a » ryan
2008-10-18 phpdoc corrections from jacobsantos. see #7918
436 * @since 2.5.0
54f091ee » ryan
2008-02-22 Allow overriding the default secret key. Proy. Props nbachiyski. fixe…
437 */
438 $wp_default_secret_key = 'put your unique phrase here';
439
440 /**
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
441 * It is possible to define this in wp-config.php
479fc2e2 » ryan
2008-01-09 phpdoc tuneup from darkdragon. see #5611
442 * @since 2.0.0
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
443 */
41afea2f » matt
2005-07-18 Let advanced users override cookies.
444 if ( !defined('USER_COOKIE') )
29ef8b6f » ryan
2007-12-16 New secure cookie protocol. see #5367
445 define('USER_COOKIE', 'wordpressuser_' . COOKIEHASH);
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
446
447 /**
448 * It is possible to define this in wp-config.php
479fc2e2 » ryan
2008-01-09 phpdoc tuneup from darkdragon. see #5611
449 * @since 2.0.0
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
450 */
41afea2f » matt
2005-07-18 Let advanced users override cookies.
451 if ( !defined('PASS_COOKIE') )
29ef8b6f » ryan
2007-12-16 New secure cookie protocol. see #5367
452 define('PASS_COOKIE', 'wordpresspass_' . COOKIEHASH);
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
453
454 /**
455 * It is possible to define this in wp-config.php
3fc6097a » ryan
2008-10-18 phpdoc corrections from jacobsantos. see #7918
456 * @since 2.5.0
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
457 */
29ef8b6f » ryan
2007-12-16 New secure cookie protocol. see #5367
458 if ( !defined('AUTH_COOKIE') )
459 define('AUTH_COOKIE', 'wordpress_' . COOKIEHASH);
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
460
461 /**
462 * It is possible to define this in wp-config.php
3fc6097a » ryan
2008-10-18 phpdoc corrections from jacobsantos. see #7918
463 * @since 2.6.0
9771ec51 » ryan
2008-05-27 First cut and better admin SSL support. see #7001
464 */
465 if ( !defined('SECURE_AUTH_COOKIE') )
466 define('SECURE_AUTH_COOKIE', 'wordpress_sec_' . COOKIEHASH);
467
468 /**
469 * It is possible to define this in wp-config.php
3fc6097a » ryan
2008-10-18 phpdoc corrections from jacobsantos. see #7918
470 * @since 2.6.0
6adcab8b » ryan
2008-06-11 Introduce logged_in cookie. Deliver auth cookies only to wp-admin. se…
471 */
472 if ( !defined('LOGGED_IN_COOKIE') )
473 define('LOGGED_IN_COOKIE', 'wordpress_logged_in_' . COOKIEHASH);
474
475 /**
476 * It is possible to define this in wp-config.php
479fc2e2 » ryan
2008-01-09 phpdoc tuneup from darkdragon. see #5611
477 * @since 2.3.0
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
478 */
2662be20 » westi
2007-09-02 Inform the user when cookies are disabled and login fails. Fixed #203…
479 if ( !defined('TEST_COOKIE') )
480 define('TEST_COOKIE', 'wordpress_test_cookie');
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
481
482 /**
483 * It is possible to define this in wp-config.php
479fc2e2 » ryan
2008-01-09 phpdoc tuneup from darkdragon. see #5611
484 * @since 1.2.0
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
485 */
41afea2f » matt
2005-07-18 Let advanced users override cookies.
486 if ( !defined('COOKIEPATH') )
849a0d29 » ryan
2006-08-30 Use get_option instead of get_settings. Just 'cause.
487 define('COOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_option('home') . '/' ) );
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
488
489 /**
490 * It is possible to define this in wp-config.php
479fc2e2 » ryan
2008-01-09 phpdoc tuneup from darkdragon. see #5611
491 * @since 1.5.0
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
492 */
41afea2f » matt
2005-07-18 Let advanced users override cookies.
493 if ( !defined('SITECOOKIEPATH') )
849a0d29 » ryan
2006-08-30 Use get_option instead of get_settings. Just 'cause.
494 define('SITECOOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_option('siteurl') . '/' ) );
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
495
496 /**
497 * It is possible to define this in wp-config.php
3fc6097a » ryan
2008-10-18 phpdoc corrections from jacobsantos. see #7918
498 * @since 2.6.0
775ea980 » ryan
2008-06-27 Set auth cookie for plugins directory to support direct load plugin f…
499 */
500 if ( !defined('ADMIN_COOKIE_PATH') )
501 define( 'ADMIN_COOKIE_PATH', SITECOOKIEPATH . 'wp-admin' );
502
503 /**
504 * It is possible to define this in wp-config.php
3fc6097a » ryan
2008-10-18 phpdoc corrections from jacobsantos. see #7918
505 * @since 2.6.0
775ea980 » ryan
2008-06-27 Set auth cookie for plugins directory to support direct load plugin f…
506 */
507 if ( !defined('PLUGINS_COOKIE_PATH') )
508 define( 'PLUGINS_COOKIE_PATH', preg_replace('|https?://[^/]+|i', '', WP_PLUGIN_URL) );
509
510 /**
511 * It is possible to define this in wp-config.php
479fc2e2 » ryan
2008-01-09 phpdoc tuneup from darkdragon. see #5611
512 * @since 2.0.0
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
513 */
41afea2f » matt
2005-07-18 Let advanced users override cookies.
514 if ( !defined('COOKIE_DOMAIN') )
515 define('COOKIE_DOMAIN', false);
6adcab8b » ryan
2008-06-11 Introduce logged_in cookie. Deliver auth cookies only to wp-admin. se…
516
517 /**
518 * It is possible to define this in wp-config.php
3fc6097a » ryan
2008-10-18 phpdoc corrections from jacobsantos. see #7918
519 * @since 2.6.0
6adcab8b » ryan
2008-06-11 Introduce logged_in cookie. Deliver auth cookies only to wp-admin. se…
520 */
521 if ( !defined('FORCE_SSL_ADMIN') )
522 define('FORCE_SSL_ADMIN', false);
523 force_ssl_admin(FORCE_SSL_ADMIN);
524
525 /**
526 * It is possible to define this in wp-config.php
3fc6097a » ryan
2008-10-18 phpdoc corrections from jacobsantos. see #7918
527 * @since 2.6.0
6adcab8b » ryan
2008-06-11 Introduce logged_in cookie. Deliver auth cookies only to wp-admin. se…
528 */
529 if ( !defined('FORCE_SSL_LOGIN') )
530 define('FORCE_SSL_LOGIN', false);
531 force_ssl_login(FORCE_SSL_LOGIN);
532
6e662d70 » ryan
2008-04-14 Move define of AUTOSAVE_INTERVAL to wp-settings so that it is availab…
533 /**
534 * It is possible to define this in wp-config.php
535 * @since 2.5.0
536 */
537 if ( !defined( 'AUTOSAVE_INTERVAL' ) )
538 define( 'AUTOSAVE_INTERVAL', 60 );
35b18e50 » ryan
2008-08-09 Trailing whitespace cleanup
539
39e4f05a » azaozz
2009-07-30 Trash status updates for posts, pages, comments and attachments, prop…
540 /**
541 * It is possible to define this in wp-config.php
542 * @since 2.9.0
543 */
544 if ( !defined( 'EMPTY_TRASH_DAYS' ) )
545 define( 'EMPTY_TRASH_DAYS', 30 );
41afea2f » matt
2005-07-18 Let advanced users override cookies.
546
9dc65ab2 » saxmatt
2004-04-27 Cleaning up some includes.
547 require (ABSPATH . WPINC . '/vars.php');
edc7d7cd » saxmatt
2003-12-31 Installation cleanup.
548
ae5848d3 » ryan
2009-06-15 Register default taxonomies before theme functions are loaded to sati…
549 // make taxonomies available to plugins and themes
550 // @plugin authors: warning: this gets registered again on the init hook
551 create_initial_taxonomies();
552
c26991b1 » saxmatt
2004-02-07 Move hack file include.
553 // Check for hacks file if the option is enabled
9f1a7e49 » westi
2009-02-22 Unset once we have included all the plugins to keep things tidy. Fixe…
554 if ( get_option('hack_file') ) {
555 if ( file_exists(ABSPATH . 'my-hacks.php') )
764f50bd » markjaquith
2007-07-27 ABSPATH already has a trailing slash. Props Nazgul. fixes #4607
556 require(ABSPATH . 'my-hacks.php');
c26991b1 » saxmatt
2004-02-07 Move hack file include.
557 }
558
c664315b » markjaquith
2009-09-24 Active plugin filter, plugin deactivation array_splice() protection. …
559 $current_plugins = apply_filters( 'active_plugins', get_option( 'active_plugins' ) );
62374e5c » ryan
2009-04-08 Require active plugin files to end in .php. Props hakre. fixes #9406
560 if ( is_array($current_plugins) && !defined('WP_INSTALLING') ) {
561 foreach ( $current_plugins as $plugin ) {
562 // check the $plugin filename
563 // Validate plugin filename
564 if ( validate_file($plugin) // $plugin must validate as file
565 || '.php' != substr($plugin, -4) // $plugin must end with '.php'
566 || !file_exists(WP_PLUGIN_DIR . '/' . $plugin) // $plugin must exist
567 )
568 continue;
569
570 include_once(WP_PLUGIN_DIR . '/' . $plugin);
e733249e » saxmatt
2004-03-25 Functional plugin implementation.
571 }
62374e5c » ryan
2009-04-08 Require active plugin files to end in .php. Props hakre. fixes #9406
572 unset($plugin);
e733249e » saxmatt
2004-03-25 Functional plugin implementation.
573 }
62374e5c » ryan
2009-04-08 Require active plugin files to end in .php. Props hakre. fixes #9406
574 unset($current_plugins);
1127059a » saxmatt
2004-04-19 shutdown action hook.
575
c93efa86 » ryan
2006-06-11 Include file renames. #2525
576 require (ABSPATH . WPINC . '/pluggable.php');
08b02d95 » ryan
2005-04-04 Move plugin replacebale functions to pluggable-functions.php. http://…
577
6e181bb9 » ryan
2008-03-03 Multi-byte character safe excerpting from nbachiyski. fixes #6077
578 /*
579 * In most cases the default internal encoding is latin1, which is of no use,
580 * since we want to use the mb_ functions for utf-8 strings
581 */
c2c7fa0a » ryan
2008-03-04 Make sure encoding is not empty. Props tenpura. see #6902
582 if (function_exists('mb_internal_encoding')) {
6e80433a » ryan
2008-03-04 Fallback to UTF-8 if not valid mb_internal_encoding. Props tenpura. f…
583 if (!@mb_internal_encoding(get_option('blog_charset')))
c2c7fa0a » ryan
2008-03-04 Make sure encoding is not empty. Props tenpura. see #6902
584 mb_internal_encoding('UTF-8');
585 }
6e181bb9 » ryan
2008-03-03 Multi-byte character safe excerpting from nbachiyski. fixes #6077
586
587
70a449d8 » saxmatt
2005-02-15 Allow for plugins to kick in before everything if define in wp-config
588 if ( defined('WP_CACHE') && function_exists('wp_cache_postload') )
589 wp_cache_postload();
590
591 do_action('plugins_loaded');
592
3c8cb2b0 » ryan
2008-05-09 Revisioning for pages from mdawaffe. see #6775
593 $default_constants = array( 'WP_POST_REVISIONS' => true );
594 foreach ( $default_constants as $c => $v )
595 @define( $c, $v ); // will fail if the constant is already defined
596 unset($default_constants, $c, $v);
597
91efba11 » ryan
2005-07-05 Use wpdb->escape instead of addslashes to prepare DB bound data.
598 // If already slashed, strip.
599 if ( get_magic_quotes_gpc() ) {
6cbb6fec » ryan
2005-07-06 Stripslashes doesn't work on arrays. Add stripslashes_deep(). Props: …
600 $_GET = stripslashes_deep($_GET );
601 $_POST = stripslashes_deep($_POST );
602 $_COOKIE = stripslashes_deep($_COOKIE);
65bbec71 » saxmatt
2004-12-16 Comments refactoring and cleanup
603 }
604
91efba11 » ryan
2005-07-05 Use wpdb->escape instead of addslashes to prepare DB bound data.
605 // Escape with wpdb.
606 $_GET = add_magic_quotes($_GET );
607 $_POST = add_magic_quotes($_POST );
608 $_COOKIE = add_magic_quotes($_COOKIE);
609 $_SERVER = add_magic_quotes($_SERVER);
610
a431376d » markjaquith
2009-07-31 Be consistent about slashing _REQUEST superglobal. props dd32. fixes …
611 // Force REQUEST to be GET + POST. If SERVER, COOKIE, or ENV are needed, use those superglobals directly.
612 $_REQUEST = array_merge($_GET, $_POST);
613
1034767a » ryan
2006-06-22 wp_get_current_commenter()
614 do_action('sanitize_comment_cookies');
615
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
616 /**
617 * WordPress Query object
618 * @global object $wp_the_query
479fc2e2 » ryan
2008-01-09 phpdoc tuneup from darkdragon. see #5611
619 * @since 2.0.0
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
620 */
22bee1c9 » ryan
2006-11-09 Preserve the original query object as wp_the_query so that it's not s…
621 $wp_the_query =& new WP_Query();
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
622
623 /**
624 * Holds the reference to @see $wp_the_query
625 * Use this global for WordPress queries
626 * @global object $wp_query
479fc2e2 » ryan
2008-01-09 phpdoc tuneup from darkdragon. see #5611
627 * @since 1.5.0
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
628 */
22bee1c9 » ryan
2006-11-09 Preserve the original query object as wp_the_query so that it's not s…
629 $wp_query =& $wp_the_query;
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
630
631 /**
632 * Holds the WordPress Rewrite object for creating pretty URLs
633 * @global object $wp_rewrite
479fc2e2 » ryan
2008-01-09 phpdoc tuneup from darkdragon. see #5611
634 * @since 1.5.0
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
635 */
22bee1c9 » ryan
2006-11-09 Preserve the original query object as wp_the_query so that it's not s…
636 $wp_rewrite =& new WP_Rewrite();
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
637
638 /**
639 * WordPress Object
640 * @global object $wp
479fc2e2 » ryan
2008-01-09 phpdoc tuneup from darkdragon. see #5611
641 * @since 2.0.0
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
642 */
22bee1c9 » ryan
2006-11-09 Preserve the original query object as wp_the_query so that it's not s…
643 $wp =& new WP();
1baf503d » ryan
2005-06-10 Break blog header up into functional chunks. Stick it all in a WP cla…
644
1eab8fcc » ryan
2009-03-17 Introduce singleton widget factory
645 /**
646 * WordPress Widget Factory Object
647 * @global object $wp_widget_factory
648 * @since 2.8.0
649 */
650 $wp_widget_factory =& new WP_Widget_Factory();
651
bc07ef1e » ryan
2008-05-20 Theme preview and thickbox CSS cleanup. Props azaozz. see #5486
652 do_action('setup_theme');
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
653
654 /**
655 * Web Path to the current active template directory
3fc6097a » ryan
2008-10-18 phpdoc corrections from jacobsantos. see #7918
656 * @since 1.5.0
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
657 */
98aa7f59 » ryan
2005-07-13 Rearrange load order. Init classes before loading the text domain and…
658 define('TEMPLATEPATH', get_template_directory());
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
659
660 /**
661 * Web Path to the current active template stylesheet directory
3fc6097a » ryan
2008-10-18 phpdoc corrections from jacobsantos. see #7918
662 * @since 2.1.0
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
663 */
b55b6aa2 » ryan
2006-08-30 Allow stylesheet only themes to provide functions.php. Props skeltoac…
664 define('STYLESHEETPATH', get_stylesheet_directory());
98aa7f59 » ryan
2005-07-13 Rearrange load order. Init classes before loading the text domain and…
665
666 // Load the default text localization domain.
667 load_default_textdomain();
668
479fc2e2 » ryan
2008-01-09 phpdoc tuneup from darkdragon. see #5611
669 /**
670 * The locale of the blog
671 * @since 1.5.0
672 */
3e264693 » ryan
2007-01-08 Load locale specific php code in global context. fixes #3488
673 $locale = get_locale();
6c8d35de » ryan
2008-05-27 Allow wp-content to exist outside of webroot. Props sambauers. see #6938
674 $locale_file = WP_LANG_DIR . "/$locale.php";
3e264693 » ryan
2007-01-08 Load locale specific php code in global context. fixes #3488
675 if ( is_readable($locale_file) )
676 require_once($locale_file);
677
98aa7f59 » ryan
2005-07-13 Rearrange load order. Init classes before loading the text domain and…
678 // Pull in locale data after loading text domain.
679 require_once(ABSPATH . WPINC . '/locale.php');
680
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
681 /**
682 * WordPress Locale object for loading locale domain date and various strings.
683 * @global object $wp_locale
479fc2e2 » ryan
2008-01-09 phpdoc tuneup from darkdragon. see #5611
684 * @since 2.1.0
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
685 */
92421de7 » ryan
2006-11-19 Ref more singletons.
686 $wp_locale =& new WP_Locale();
3d2347a6 » ryan
2006-04-02 WP_Locale. Props Sewar. fixes #2568
687
c369310b » ryan
2005-08-29 Better support for theme plugins. add_theme_page() and active theme f…
688 // Load functions for active theme.
b55b6aa2 » ryan
2006-08-30 Allow stylesheet only themes to provide functions.php. Props skeltoac…
689 if ( TEMPLATEPATH !== STYLESHEETPATH && file_exists(STYLESHEETPATH . '/functions.php') )
690 include(STYLESHEETPATH . '/functions.php');
691 if ( file_exists(TEMPLATEPATH . '/functions.php') )
692 include(TEMPLATEPATH . '/functions.php');
c369310b » ryan
2005-08-29 Better support for theme plugins. add_theme_page() and active theme f…
693
7251aff3 » westi
2009-11-01 Introduce require_if_theme_supports(), move post thumbnails functions…
694 // Load in support for template functions which the theme supports
695 require_if_theme_supports( 'post-thumbnails', ABSPATH . WPINC . '/post-image-template.php' );
696
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
697 /**
3fc6097a » ryan
2008-10-18 phpdoc corrections from jacobsantos. see #7918
698 * Runs just before PHP shuts down execution.
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
699 *
700 * @access private
3fc6097a » ryan
2008-10-18 phpdoc corrections from jacobsantos. see #7918
701 * @since 1.2.0
75dc7786 » westi
2007-12-20 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
702 */
98aa7f59 » ryan
2005-07-13 Rearrange load order. Init classes before loading the text domain and…
703 function shutdown_action_hook() {
704 do_action('shutdown');
84da5fc9 » ryan
2006-01-06 Save cache after the shutdown hook runs. fixes #2232
705 wp_cache_close();
98aa7f59 » ryan
2005-07-13 Rearrange load order. Init classes before loading the text domain and…
706 }
707 register_shutdown_function('shutdown_action_hook');
708
251ad300 » ryan
2008-01-09 Call WP::init() just before kicking the init action so that the curre…
709 $wp->init(); // Sets up current user.
710
1baf503d » ryan
2005-06-10 Break blog header up into functional chunks. Stick it all in a WP cla…
711 // Everything is loaded and initialized.
98386088 » rboren
2005-02-01 Allow multiple args to be passed to apply_filters and do_action. Move…
712 do_action('init');
06a0fc3a » matt
2005-11-11 Formatting
713
629dde86 » rob1n
2007-05-25 Actually check for PHP 4.2. Props nbachiyski. fixes #4336
714 ?>
Something went wrong with that request. Please try again.