-// Change to E_ALL for development/debugging
-error_reporting(E_ALL ^ E_NOTICE);
-
-// For an advanced caching plugin to use, static because you would only want one
-if ( defined('WP_CACHE') )
- require (ABSPATH . 'wp-content/advanced-cache.php');
-
-define('WPINC', 'wp-includes');
-require_once (ABSPATH . WPINC . '/wp-db.php');
-
-// Table names
-$wpdb->posts = $table_prefix . 'posts';
-$wpdb->users = $table_prefix . 'users';
-$wpdb->categories = $table_prefix . 'categories';
-$wpdb->post2cat = $table_prefix . 'post2cat';
-$wpdb->comments = $table_prefix . 'comments';
-$wpdb->links = $table_prefix . 'links';
-$wpdb->linkcategories = $table_prefix . 'linkcategories';
-$wpdb->options = $table_prefix . 'options';
-$wpdb->postmeta = $table_prefix . 'postmeta';
-$wpdb->usermeta = $table_prefix . 'usermeta';
-
-$wpdb->prefix = $table_prefix;
-
-if ( defined('CUSTOM_USER_TABLE') )
- $wpdb->users = CUSTOM_USER_TABLE;
-if ( defined('CUSTOM_USER_META_TABLE') )
- $wpdb->usermeta = CUSTOM_USER_META_TABLE;
-
-// We're going to need to keep this around for a few months even though we're not using it internally
-
-$tableposts = $wpdb->posts;
-$tableusers = $wpdb->users;
-$tablecategories = $wpdb->categories;
-$tablepost2cat = $wpdb->post2cat;
-$tablecomments = $wpdb->comments;
-$tablelinks = $wpdb->links;
-$tablelinkcategories = $wpdb->linkcategories;
-$tableoptions = $wpdb->options;
-$tablepostmeta = $wpdb->postmeta;
-
-if ( file_exists(ABSPATH . 'wp-content/object-cache.php') )
- require (ABSPATH . 'wp-content/object-cache.php');
-else
- require (ABSPATH . WPINC . '/cache.php');
-
-// To disable persistant caching, add the below line to your wp-config.php file, uncommented of course.
-// define('DISABLE_CACHE', true);
-
-wp_cache_init();
-
-require (ABSPATH . WPINC . '/functions.php');
-require (ABSPATH . WPINC . '/default-filters.php');
-require_once (ABSPATH . WPINC . '/wp-l10n.php');
-
-$wpdb->hide_errors();
-$db_check = $wpdb->get_var("SELECT option_value FROM $wpdb->options WHERE option_name = 'siteurl'");
-if ( !$db_check && (!strstr($_SERVER['PHP_SELF'], 'install.php') && !defined('WP_INSTALLING')) ) {
- if ( strstr($_SERVER['PHP_SELF'], 'wp-admin') )
- $link = 'install.php';
- else
- $link = 'wp-admin/install.php';
- die(sprintf(__("It doesn't look like you've installed WP yet. Try running <a href='%s'>install.php</a>."), $link));
+register_shutdown_function( 'shutdown_action_hook' );
+
+// Stop most of WordPress from being loaded if we just want the basics.
+if ( SHORTINIT )
+ return false;
+
+// Load the L10n library.
+require_once( ABSPATH . WPINC . '/l10n.php' );
+
+// Run the installer if WordPress is not installed.
+wp_not_installed();
+
+// Load most of WordPress.
+require( ABSPATH . WPINC . '/class-wp-walker.php' );
+require( ABSPATH . WPINC . '/class-wp-ajax-response.php' );
+require( ABSPATH . WPINC . '/formatting.php' );
+require( ABSPATH . WPINC . '/capabilities.php' );
+require( ABSPATH . WPINC . '/query.php' );
+require( ABSPATH . WPINC . '/theme.php' );
+require( ABSPATH . WPINC . '/class-wp-theme.php' );
+require( ABSPATH . WPINC . '/template.php' );
+require( ABSPATH . WPINC . '/user.php' );
+require( ABSPATH . WPINC . '/meta.php' );
+require( ABSPATH . WPINC . '/general-template.php' );
+require( ABSPATH . WPINC . '/link-template.php' );
+require( ABSPATH . WPINC . '/author-template.php' );
+require( ABSPATH . WPINC . '/post.php' );
+require( ABSPATH . WPINC . '/post-template.php' );
+require( ABSPATH . WPINC . '/revision.php' );
+require( ABSPATH . WPINC . '/post-formats.php' );
+require( ABSPATH . WPINC . '/post-thumbnail-template.php' );
+require( ABSPATH . WPINC . '/category.php' );
+require( ABSPATH . WPINC . '/category-template.php' );
+require( ABSPATH . WPINC . '/comment.php' );
+require( ABSPATH . WPINC . '/comment-template.php' );
+require( ABSPATH . WPINC . '/rewrite.php' );
+require( ABSPATH . WPINC . '/feed.php' );
+require( ABSPATH . WPINC . '/bookmark.php' );
+require( ABSPATH . WPINC . '/bookmark-template.php' );
+require( ABSPATH . WPINC . '/kses.php' );
+require( ABSPATH . WPINC . '/cron.php' );
+require( ABSPATH . WPINC . '/deprecated.php' );
+require( ABSPATH . WPINC . '/script-loader.php' );
+require( ABSPATH . WPINC . '/taxonomy.php' );
+require( ABSPATH . WPINC . '/update.php' );
+require( ABSPATH . WPINC . '/canonical.php' );
+require( ABSPATH . WPINC . '/shortcodes.php' );
+require( ABSPATH . WPINC . '/class-wp-embed.php' );
+require( ABSPATH . WPINC . '/media.php' );
+require( ABSPATH . WPINC . '/http.php' );
+require( ABSPATH . WPINC . '/class-http.php' );
+require( ABSPATH . WPINC . '/widgets.php' );
+require( ABSPATH . WPINC . '/nav-menu.php' );
+require( ABSPATH . WPINC . '/nav-menu-template.php' );
+require( ABSPATH . WPINC . '/admin-bar.php' );
+
+// Load multisite-specific files.
+if ( is_multisite() ) {
+ require( ABSPATH . WPINC . '/ms-functions.php' );
+ require( ABSPATH . WPINC . '/ms-default-filters.php' );
+ require( ABSPATH . WPINC . '/ms-deprecated.php' );