Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 312 lines (250 sloc) 9.496 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 /**
58d4742 More pedantry. "Setup" is not a verb. http://notaverb.com/setup
markjaquith authored
3 * Used to set up and fix common variables and include
75dc778 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
westi authored
4 * the WordPress procedural and class library.
5 *
439d50d Cleanup wp-settings. Move functions needed at startup into load.php. P...
ryan authored
6 * Allows for some configuration in wp-config.php (see default-constants.php)
75dc778 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
westi authored
7 *
8 * @package WordPress
9 */
10
dbd2459 multi-site startup, See #11644
wpmuguru authored
11 /**
439d50d Cleanup wp-settings. Move functions needed at startup into load.php. P...
ryan authored
12 * Stores the location of the WordPress directory of functions, classes, and core content.
dbd2459 multi-site startup, See #11644
wpmuguru authored
13 *
439d50d Cleanup wp-settings. Move functions needed at startup into load.php. P...
ryan authored
14 * @since 1.0.0
dbd2459 multi-site startup, See #11644
wpmuguru authored
15 */
506c22b phpdoc for load.php, return some includes to global scope. Props nacin. ...
ryan authored
16 define( 'WPINC', 'wp-includes' );
dbd2459 multi-site startup, See #11644
wpmuguru authored
17
506c22b phpdoc for load.php, return some includes to global scope. Props nacin. ...
ryan authored
18 // Include files required for initialization.
19 require( ABSPATH . WPINC . '/load.php' );
20 require( ABSPATH . WPINC . '/default-constants.php' );
21 require( ABSPATH . WPINC . '/version.php' );
5c2f29c Increase memory limit. Props darkdragon. see #3141
ryan authored
22
506c22b phpdoc for load.php, return some includes to global scope. Props nacin. ...
ryan authored
23 // Set initial default constants including WP_MEMORY_LIMIT, WP_DEBUG, WP_CONTENT_DIR and WP_CACHE.
60dc67e Improve the implementation of the default constant defining functions. S...
westi authored
24 wp_initial_constants( );
5c2f29c Increase memory limit. Props darkdragon. see #3141
ryan authored
25
506c22b phpdoc for load.php, return some includes to global scope. Props nacin. ...
ryan authored
26 // Disable magic quotes at runtime. Magic quotes are added using wpdb later in wp-settings.php.
27 set_magic_quotes_runtime( 0 );
28 @ini_set( 'magic_quotes_sybase', 0 );
6e181bb Multi-byte character safe excerpting from nbachiyski. fixes #6077
ryan authored
29
506c22b phpdoc for load.php, return some includes to global scope. Props nacin. ...
ryan authored
30 // Set default timezone in PHP 5.
31 if ( function_exists( 'date_default_timezone_set' ) )
32 date_default_timezone_set( 'UTC' );
2371043 Set default timezone. Props Denis-de-Bernardy. fixes #10940
ryan authored
33
506c22b phpdoc for load.php, return some includes to global scope. Props nacin. ...
ryan authored
34 // Turn register_globals off.
321c310 Remove trailing whitespace
ryan authored
35 wp_unregister_GLOBALS();
d4f95b7 Accidental commit. Props Nazgul. fixes #4437
rob1n authored
36
506c22b phpdoc for load.php, return some includes to global scope. Props nacin. ...
ryan authored
37 // Ensure these global variables do not exist so they do not interfere with WordPress.
479fc2e phpdoc tuneup from darkdragon. see #5611
ryan authored
38 unset( $wp_filter, $cache_lastcommentmodified, $cache_lastpostdate );
376ec4d Tweak
matt authored
39
506c22b phpdoc for load.php, return some includes to global scope. Props nacin. ...
ryan authored
40 // Standardize $_SERVER variables across setups.
439d50d Cleanup wp-settings. Move functions needed at startup into load.php. P...
ryan authored
41 wp_fix_server_vars();
c50e7da Fixes #1591 (again)
matt authored
42
506c22b phpdoc for load.php, return some includes to global scope. Props nacin. ...
ryan authored
43 // Check for the required PHP version and for the MySQL extension or a database drop-in.
439d50d Cleanup wp-settings. Move functions needed at startup into load.php. P...
ryan authored
44 wp_check_php_mysql_versions();
885ee8f This should fix permalinks, but may break the PHP as CGI funkiness again
matt authored
45
dbfb51c Trim trailing whites
ryan authored
46 // Check if we have recieved a request due to missing favicon.ico
a60b801 Bail early for favicon.ico requests so we don't load WP twice. Props aza...
nacin authored
47 wp_favicon_request();
48
506c22b phpdoc for load.php, return some includes to global scope. Props nacin. ...
ryan authored
49 // Check if we're in maintenance mode.
439d50d Cleanup wp-settings. Move functions needed at startup into load.php. P...
ryan authored
50 wp_maintenance();
0f7bb42 timer_stop() wanted to be near timer_start().
ryan authored
51
506c22b phpdoc for load.php, return some includes to global scope. Props nacin. ...
ryan authored
52 // Start loading timer.
551e52f Code cleanup and some fixes from the WP Japan folks.
saxmatt authored
53 timer_start();
da4a0d9 Fix for empty plugin strings, class include moved for timing.
saxmatt authored
54
506c22b phpdoc for load.php, return some includes to global scope. Props nacin. ...
ryan authored
55 // Check if we're in WP_DEBUG mode.
439d50d Cleanup wp-settings. Move functions needed at startup into load.php. P...
ryan authored
56 wp_debug_mode();
9b09572 Turn down error reporting.
saxmatt authored
57
506c22b phpdoc for load.php, return some includes to global scope. Props nacin. ...
ryan authored
58 // For an advanced caching plugin to use. Uses a static drop-in because you would only want one.
439d50d Cleanup wp-settings. Move functions needed at startup into load.php. P...
ryan authored
59 if ( WP_CACHE )
7843826 Don't silence inclusion of advanced-cache.php for WP_DEBUG. fixes #13185...
nacin authored
60 WP_DEBUG ? include( WP_CONTENT_DIR . '/advanced-cache.php' ) : @include( WP_CONTENT_DIR . '/advanced-cache.php' );
70a449d Allow for plugins to kick in before everything if define in wp-config
saxmatt authored
61
506c22b phpdoc for load.php, return some includes to global scope. Props nacin. ...
ryan authored
62 // Define WP_LANG_DIR if not set.
439d50d Cleanup wp-settings. Move functions needed at startup into load.php. P...
ryan authored
63 wp_set_lang_dir();
0c6394a Stop fatal error in post revisions when setting the include path is disa...
azaozz authored
64
98e8daa Add ability to query by domain and/or path to get_blog_details(). Improv...
ryan authored
65 // Load early WordPress files.
506c22b phpdoc for load.php, return some includes to global scope. Props nacin. ...
ryan authored
66 require( ABSPATH . WPINC . '/compat.php' );
67 require( ABSPATH . WPINC . '/functions.php' );
731bf1f Begin the dissolution of classes.php. see #10287.
nacin authored
68 require( ABSPATH . WPINC . '/class-wp.php' );
69 require( ABSPATH . WPINC . '/class-wp-error.php' );
70 require( ABSPATH . WPINC . '/class-wp-walker.php' );
506c22b phpdoc for load.php, return some includes to global scope. Props nacin. ...
ryan authored
71 require( ABSPATH . WPINC . '/classes.php' );
731bf1f Begin the dissolution of classes.php. see #10287.
nacin authored
72 require( ABSPATH . WPINC . '/class-wp-ajax-response.php' );
34a2856 Require plugin.php earlier so all pluggables can get at it. Props skelto...
ryan authored
73 require( ABSPATH . WPINC . '/plugin.php' );
b36471d Use wp_die() for WPDB bails. Send 500 response and no-cache headers so ...
markjaquith authored
74
9e97f25 Always include wp-db.php. Prevents a conditional include and allows db d...
nacin authored
75 // Include the wpdb class and, if present, a db.php database drop-in.
658d22d Store field types in wpdb object. Props mdawaffe. see #7171
ryan authored
76 require_wp_db();
77
506c22b phpdoc for load.php, return some includes to global scope. Props nacin. ...
ryan authored
78 // Set the database table prefix and the format specifiers for database table columns.
439d50d Cleanup wp-settings. Move functions needed at startup into load.php. P...
ryan authored
79 wp_set_wpdb_vars();
d2110af Define wp_clone() before loading the cache.
ryan authored
80
506c22b phpdoc for load.php, return some includes to global scope. Props nacin. ...
ryan authored
81 // Start the WordPress object cache, or an external object cache if the drop-in is present.
439d50d Cleanup wp-settings. Move functions needed at startup into load.php. P...
ryan authored
82 wp_start_object_cache();
1c55a42 Move is_admin() to wp-settings.php so it's available when query.php is n...
azaozz authored
83
98e8daa Add ability to query by domain and/or path to get_blog_details(). Improv...
ryan authored
84 // Load early WordPress files.
85 require( ABSPATH . WPINC . '/default-filters.php' );
687e7d1 Force fatal errors via require() if we're missing something we need. fix...
nacin authored
86 require( ABSPATH . WPINC . '/pomo/mo.php' );
98e8daa Add ability to query by domain and/or path to get_blog_details(). Improv...
ryan authored
87
506c22b phpdoc for load.php, return some includes to global scope. Props nacin. ...
ryan authored
88 // Initialize multisite if enabled.
731eada Move blogs table related functions to blogs.php. Include it before ms-se...
ryan authored
89 if ( is_multisite() ) {
dfe271c Rename wp-includes/blogs.php to ms-blogs.php. See #11644
nacin authored
90 require( ABSPATH . WPINC . '/ms-blogs.php' );
493a307 rearrage multisite initialization, remove deprecated $wpmuBaseTablePrefi...
wpmuguru authored
91 require( ABSPATH . WPINC . '/ms-settings.php' );
751a7d1 Prevent half-baked loading of MS that would happen when constants are ad...
nacin authored
92 } elseif ( ! defined( 'MULTISITE' ) ) {
93 define( 'MULTISITE', false );
731eada Move blogs table related functions to blogs.php. Include it before ms-se...
ryan authored
94 }
dbd2459 multi-site startup, See #11644
wpmuguru authored
95
506c22b phpdoc for load.php, return some includes to global scope. Props nacin. ...
ryan authored
96 // Stop most of WordPress from being loaded if we just want the basics.
97 if ( SHORTINIT )
dbd2459 multi-site startup, See #11644
wpmuguru authored
98 return false;
99
506c22b phpdoc for load.php, return some includes to global scope. Props nacin. ...
ryan authored
100 // Load the l18n library.
687e7d1 Force fatal errors via require() if we're missing something we need. fix...
nacin authored
101 require( ABSPATH . WPINC . '/l10n.php' );
1bd4057 Bug fixes
saxmatt authored
102
506c22b phpdoc for load.php, return some includes to global scope. Props nacin. ...
ryan authored
103 // Run the installer if WordPress is not installed.
439d50d Cleanup wp-settings. Move functions needed at startup into load.php. P...
ryan authored
104 wp_not_installed();
1bd4057 Bug fixes
saxmatt authored
105
506c22b phpdoc for load.php, return some includes to global scope. Props nacin. ...
ryan authored
106 // Load most of WordPress.
107 require( ABSPATH . WPINC . '/formatting.php' );
108 require( ABSPATH . WPINC . '/capabilities.php' );
7312ccc Move WP_Object_Query to it's own file. See #15032
scribu authored
109 require( ABSPATH . WPINC . '/class.wp-object-query.php' );
506c22b phpdoc for load.php, return some includes to global scope. Props nacin. ...
ryan authored
110 require( ABSPATH . WPINC . '/query.php' );
111 require( ABSPATH . WPINC . '/theme.php' );
112 require( ABSPATH . WPINC . '/user.php' );
113 require( ABSPATH . WPINC . '/meta.php' );
114 require( ABSPATH . WPINC . '/general-template.php' );
115 require( ABSPATH . WPINC . '/link-template.php' );
116 require( ABSPATH . WPINC . '/author-template.php' );
117 require( ABSPATH . WPINC . '/post.php' );
118 require( ABSPATH . WPINC . '/post-template.php' );
119 require( ABSPATH . WPINC . '/category.php' );
120 require( ABSPATH . WPINC . '/category-template.php' );
121 require( ABSPATH . WPINC . '/comment.php' );
122 require( ABSPATH . WPINC . '/comment-template.php' );
123 require( ABSPATH . WPINC . '/rewrite.php' );
124 require( ABSPATH . WPINC . '/feed.php' );
125 require( ABSPATH . WPINC . '/bookmark.php' );
126 require( ABSPATH . WPINC . '/bookmark-template.php' );
127 require( ABSPATH . WPINC . '/kses.php' );
128 require( ABSPATH . WPINC . '/cron.php' );
129 require( ABSPATH . WPINC . '/deprecated.php' );
130 require( ABSPATH . WPINC . '/script-loader.php' );
131 require( ABSPATH . WPINC . '/taxonomy.php' );
132 require( ABSPATH . WPINC . '/update.php' );
133 require( ABSPATH . WPINC . '/canonical.php' );
134 require( ABSPATH . WPINC . '/shortcodes.php' );
135 require( ABSPATH . WPINC . '/media.php' );
136 require( ABSPATH . WPINC . '/http.php' );
1f93931 Always include class-http.php. see #12990
ryan authored
137 require( ABSPATH . WPINC . '/class-http.php' );
506c22b phpdoc for load.php, return some includes to global scope. Props nacin. ...
ryan authored
138 require( ABSPATH . WPINC . '/widgets.php' );
d5074db Reorg nav menu files. see #11817
ryan authored
139 require( ABSPATH . WPINC . '/nav-menu.php' );
140 require( ABSPATH . WPINC . '/nav-menu-template.php' );
b500820 Admin bar, first pass. see #14772
ryan authored
141 require( ABSPATH . WPINC . '/admin-bar.php' );
506c22b phpdoc for load.php, return some includes to global scope. Props nacin. ...
ryan authored
142
143 // Load multisite-specific files.
f5e1226 Introduce is_multisite(). see #11644
ryan authored
144 if ( is_multisite() ) {
687e7d1 Force fatal errors via require() if we're missing something we need. fix...
nacin authored
145 require( ABSPATH . WPINC . '/ms-functions.php' );
146 require( ABSPATH . WPINC . '/ms-default-filters.php' );
147 require( ABSPATH . WPINC . '/ms-deprecated.php' );
f5e1226 Introduce is_multisite(). see #11644
ryan authored
148 }
149
506c22b phpdoc for load.php, return some includes to global scope. Props nacin. ...
ryan authored
150 // Define constants that rely on the API to obtain the default value.
151 // Define must-use plugin directory constants, which may be overridden in the sunrise.php drop-in.
60dc67e Improve the implementation of the default constant defining functions. S...
westi authored
152 wp_plugin_directory_constants( );
439d50d Cleanup wp-settings. Move functions needed at startup into load.php. P...
ryan authored
153
506c22b phpdoc for load.php, return some includes to global scope. Props nacin. ...
ryan authored
154 // Load must-use plugins.
0206ffe Improve function naming for plugin file discovery functions.
westi authored
155 foreach ( wp_get_mu_plugins() as $mu_plugin ) {
506c22b phpdoc for load.php, return some includes to global scope. Props nacin. ...
ryan authored
156 include_once( $mu_plugin );
157 }
1592ca9 Cleanup network plugin loading. Props nacin. see #11644
ryan authored
158 unset( $mu_plugin );
dbd2459 multi-site startup, See #11644
wpmuguru authored
159
506c22b phpdoc for load.php, return some includes to global scope. Props nacin. ...
ryan authored
160 do_action( 'muplugins_loaded' );
3bf4ed1 Support mu-plugins for 'Must Use' autoload plugins
ryan authored
161
ff140f1 Move ms_site_check() to after init and allow super admins to view blocke...
ryan authored
162 if ( is_multisite() )
b20c3c4 Improve the implementation of the default constant defining functions fo...
westi authored
163 ms_cookie_constants( );
9771ec5 First cut and better admin SSL support. see #7001
ryan authored
164
506c22b phpdoc for load.php, return some includes to global scope. Props nacin. ...
ryan authored
165 // Define constants after multisite is loaded. Cookie-related constants may be overridden in ms_network_cookies().
60dc67e Improve the implementation of the default constant defining functions. S...
westi authored
166 wp_cookie_constants( );
167
168 // Define and enforce our SSL constants
169 wp_ssl_constants( );
41afea2 Let advanced users override cookies.
matt authored
170
506c22b phpdoc for load.php, return some includes to global scope. Props nacin. ...
ryan authored
171 // Create common globals.
172 require( ABSPATH . WPINC . '/vars.php' );
edc7d7c Installation cleanup.
saxmatt authored
173
9826fcb Call create_initial_post_types() before plugins and themes are loaded so...
ryan authored
174 // Make taxonomies and posts available to plugins and themes.
175 // @plugin authors: warning: these get registered again on the init hook.
ae5848d Register default taxonomies before theme functions are loaded to satisfy...
ryan authored
176 create_initial_taxonomies();
9826fcb Call create_initial_post_types() before plugins and themes are loaded so...
ryan authored
177 create_initial_post_types();
ae5848d Register default taxonomies before theme functions are loaded to satisfy...
ryan authored
178
506c22b phpdoc for load.php, return some includes to global scope. Props nacin. ...
ryan authored
179 // Load active plugins.
0206ffe Improve function naming for plugin file discovery functions.
westi authored
180 foreach ( wp_get_active_and_valid_plugins() as $plugin )
506c22b phpdoc for load.php, return some includes to global scope. Props nacin. ...
ryan authored
181 include_once( $plugin );
182 unset( $plugin );
1127059 shutdown action hook.
saxmatt authored
183
506c22b phpdoc for load.php, return some includes to global scope. Props nacin. ...
ryan authored
184 // Load pluggable functions.
185 require( ABSPATH . WPINC . '/pluggable.php' );
54c4ac3 Move deprecated pluggable functions to a new file to lower their profile...
nacin authored
186 require( ABSPATH . WPINC . '/pluggable-deprecated.php' );
08b02d9 Move plugin replacebale functions to pluggable-functions.php. http://mo...
ryan authored
187
506c22b phpdoc for load.php, return some includes to global scope. Props nacin. ...
ryan authored
188 // Set internal encoding.
439d50d Cleanup wp-settings. Move functions needed at startup into load.php. P...
ryan authored
189 wp_set_internal_encoding();
6e181bb Multi-byte character safe excerpting from nbachiyski. fixes #6077
ryan authored
190
506c22b phpdoc for load.php, return some includes to global scope. Props nacin. ...
ryan authored
191 // Run wp_cache_postload() if object cache is enabled and the function exists.
192 if ( WP_CACHE && function_exists( 'wp_cache_postload' ) )
70a449d Allow for plugins to kick in before everything if define in wp-config
saxmatt authored
193 wp_cache_postload();
194
506c22b phpdoc for load.php, return some includes to global scope. Props nacin. ...
ryan authored
195 do_action( 'plugins_loaded' );
70a449d Allow for plugins to kick in before everything if define in wp-config
saxmatt authored
196
60dc67e Improve the implementation of the default constant defining functions. S...
westi authored
197 // Define constants which affect functionality if not already defined.
198 wp_functionality_constants( );
91efba1 Use wpdb->escape instead of addslashes to prepare DB bound data.
ryan authored
199
506c22b phpdoc for load.php, return some includes to global scope. Props nacin. ...
ryan authored
200 // Add magic quotes and set up $_REQUEST ( $_GET + $_POST )
439d50d Cleanup wp-settings. Move functions needed at startup into load.php. P...
ryan authored
201 wp_magic_quotes();
a431376 Be consistent about slashing _REQUEST superglobal. props dd32. fixes #10...
markjaquith authored
202
506c22b phpdoc for load.php, return some includes to global scope. Props nacin. ...
ryan authored
203 do_action( 'sanitize_comment_cookies' );
1034767 wp_get_current_commenter()
ryan authored
204
75dc778 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
westi authored
205 /**
206 * WordPress Query object
207 * @global object $wp_the_query
479fc2e phpdoc tuneup from darkdragon. see #5611
ryan authored
208 * @since 2.0.0
75dc778 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
westi authored
209 */
22bee1c Preserve the original query object as wp_the_query so that it's not stom...
ryan authored
210 $wp_the_query =& new WP_Query();
75dc778 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
westi authored
211
212 /**
213 * Holds the reference to @see $wp_the_query
214 * Use this global for WordPress queries
215 * @global object $wp_query
479fc2e phpdoc tuneup from darkdragon. see #5611
ryan authored
216 * @since 1.5.0
75dc778 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
westi authored
217 */
506c22b phpdoc for load.php, return some includes to global scope. Props nacin. ...
ryan authored
218 $wp_query =& $wp_the_query;
75dc778 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
westi authored
219
220 /**
221 * Holds the WordPress Rewrite object for creating pretty URLs
222 * @global object $wp_rewrite
479fc2e phpdoc tuneup from darkdragon. see #5611
ryan authored
223 * @since 1.5.0
75dc778 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
westi authored
224 */
506c22b phpdoc for load.php, return some includes to global scope. Props nacin. ...
ryan authored
225 $wp_rewrite =& new WP_Rewrite();
75dc778 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
westi authored
226
227 /**
228 * WordPress Object
229 * @global object $wp
479fc2e phpdoc tuneup from darkdragon. see #5611
ryan authored
230 * @since 2.0.0
75dc778 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
westi authored
231 */
506c22b phpdoc for load.php, return some includes to global scope. Props nacin. ...
ryan authored
232 $wp =& new WP();
1baf503 Break blog header up into functional chunks. Stick it all in a WP class...
ryan authored
233
1eab8fc Introduce singleton widget factory
ryan authored
234 /**
235 * WordPress Widget Factory Object
236 * @global object $wp_widget_factory
237 * @since 2.8.0
238 */
239 $wp_widget_factory =& new WP_Widget_Factory();
240
506c22b phpdoc for load.php, return some includes to global scope. Props nacin. ...
ryan authored
241 do_action( 'setup_theme' );
75dc778 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
westi authored
242
60dc67e Improve the implementation of the default constant defining functions. S...
westi authored
243 // Define the template related constants.
244 wp_templating_constants( );
98aa7f5 Rearrange load order. Init classes before loading the text domain and s...
ryan authored
245
246 // Load the default text localization domain.
247 load_default_textdomain();
248
506c22b phpdoc for load.php, return some includes to global scope. Props nacin. ...
ryan authored
249 // Find the blog locale.
250 $locale = get_locale();
251 $locale_file = WP_LANG_DIR . "/$locale.php";
252 if ( is_readable( $locale_file ) )
687e7d1 Force fatal errors via require() if we're missing something we need. fix...
nacin authored
253 require( $locale_file );
3ffb57a unset temp vars so they don't pollute the global namespace.
ryan authored
254 unset($locale_file);
506c22b phpdoc for load.php, return some includes to global scope. Props nacin. ...
ryan authored
255
256 // Pull in locale data after loading text domain.
687e7d1 Force fatal errors via require() if we're missing something we need. fix...
nacin authored
257 require( ABSPATH . WPINC . '/locale.php' );
98aa7f5 Rearrange load order. Init classes before loading the text domain and s...
ryan authored
258
75dc778 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
westi authored
259 /**
260 * WordPress Locale object for loading locale domain date and various strings.
261 * @global object $wp_locale
479fc2e phpdoc tuneup from darkdragon. see #5611
ryan authored
262 * @since 2.1.0
75dc778 phpdoc for wp-settings.php. Fixes #5211 props darkdragon.
westi authored
263 */
92421de Ref more singletons.
ryan authored
264 $wp_locale =& new WP_Locale();
3d2347a WP_Locale. Props Sewar. fixes #2568
ryan authored
265
506c22b phpdoc for load.php, return some includes to global scope. Props nacin. ...
ryan authored
266 // Load the functions for the active theme, for both parent and child theme if applicable.
267 if ( TEMPLATEPATH !== STYLESHEETPATH && file_exists( STYLESHEETPATH . '/functions.php' ) )
268 include( STYLESHEETPATH . '/functions.php' );
269 if ( file_exists( TEMPLATEPATH . '/functions.php' ) )
270 include( TEMPLATEPATH . '/functions.php' );
271
9ed7cba Rename the new 'themes_loaded' hook to 'after_setup_theme' to prevent co...
dd32 authored
272 do_action( 'after_setup_theme' );
dce728d Add 'themes_loaded' hook to run after parent/child themes have been incl...
dd32 authored
273
506c22b phpdoc for load.php, return some includes to global scope. Props nacin. ...
ryan authored
274 // Load any template functions the theme supports.
275 require_if_theme_supports( 'post-thumbnails', ABSPATH . WPINC . '/post-thumbnail-template.php' );
c369310 Better support for theme plugins. add_theme_page() and active theme fun...
ryan authored
276
506c22b phpdoc for load.php, return some includes to global scope. Props nacin. ...
ryan authored
277 register_shutdown_function( 'shutdown_action_hook' );
98aa7f5 Rearrange load order. Init classes before loading the text domain and s...
ryan authored
278
506c22b phpdoc for load.php, return some includes to global scope. Props nacin. ...
ryan authored
279 // Set up current user.
280 $wp->init();
251ad30 Call WP::init() just before kicking the init action so that the current ...
ryan authored
281
cde78a7 add a wp_loaded action that fires once WordPress init has finished. Prop...
dd32 authored
282 /**
283 * Most of WP is loaded at this stage, and the user is authenticated. WP continues
284 * to load on the init hook that follows (e.g. widgets), and many plugins instantiate
285 * themselves on it for all sorts of reasons (e.g. they need a user, a taxonomy, etc.).
286 *
287 * If you wish to plug an action once WP is loaded, use the wp_loaded hook below.
288 */
506c22b phpdoc for load.php, return some includes to global scope. Props nacin. ...
ryan authored
289 do_action( 'init' );
06a0fc3 Formatting
matt authored
290
ff140f1 Move ms_site_check() to after init and allow super admins to view blocke...
ryan authored
291 // Check site status
292 if ( is_multisite() ) {
293 if ( true !== ( $file = ms_site_check() ) ) {
294 require( $file );
295 die();
296 }
297 unset($file);
298 }
299
cde78a7 add a wp_loaded action that fires once WordPress init has finished. Prop...
dd32 authored
300 /**
601c2f4 Remove reference to file that doesn't exist. see #12400
nacin authored
301 * This hook is fired once WP, all plugins, and the theme are fully loaded and instantiated.
cde78a7 add a wp_loaded action that fires once WordPress init has finished. Prop...
dd32 authored
302 *
7957161 Remove references to wp-ajax.php. props TobiasBg, fixes #12400
nacin authored
303 * AJAX requests should use wp-admin/admin-ajax.php. admin-ajax.php can handle requests for
304 * users not logged in.
305 *
306 * @link http://codex.wordpress.org/AJAX_in_Plugins
601c2f4 Remove reference to file that doesn't exist. see #12400
nacin authored
307 *
308 * @since 3.0.0
cde78a7 add a wp_loaded action that fires once WordPress init has finished. Prop...
dd32 authored
309 */
310 do_action('wp_loaded');
44e5115 internalize uploaded media rewrite rule, see #11742
wpmuguru authored
311 ?>
Something went wrong with that request. Please try again.