X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/cc7b1505cd9fafd87c3672f669e13e98b0c544f7..58f607a1de715c9bca69340a4d6fb9e1b9c2bed2:/wp-admin/admin.php
diff --git a/wp-admin/admin.php b/wp-admin/admin.php
index 756cc480..998ff1ff 100644
--- a/wp-admin/admin.php
+++ b/wp-admin/admin.php
@@ -1,15 +1,57 @@
flush_rules();
+ update_option( 'db_upgraded', false );
+
+ /**
+ * Runs on the next page load after successful upgrade
+ *
+ * @since 2.8
+ */
+ do_action('after_db_upgrade');
+} elseif ( get_option('db_version') != $wp_db_version ) {
+ if ( !is_multisite() ) {
+ wp_redirect(admin_url('upgrade.php?_wp_http_referer=' . urlencode(stripslashes($_SERVER['REQUEST_URI']))));
+ exit;
+ } elseif ( apply_filters( 'do_mu_upgrade', true ) ) {
+ /**
+ * On really small MU installs run the upgrader every time,
+ * else run it less often to reduce load.
+ *
+ * @since 2.8.4b
+ */
+ $c = get_blog_count();
+ if ( $c <= 50 || ( $c > 50 && mt_rand( 0, (int)( $c / 50 ) ) == 1 ) ) {
+ require_once( ABSPATH . WPINC . '/http.php' );
+ $response = wp_remote_get( admin_url( 'upgrade.php?step=1' ), array( 'timeout' => 120, 'httpversion' => '1.1' ) );
+ do_action( 'after_mu_upgrade', $response );
+ unset($response);
+ }
+ unset($c);
+ }
+}
-if ( get_option('db_version') != $wp_db_version )
- die (sprintf(__("Your database is out-of-date. Please upgrade."), get_option('siteurl') . '/wp-admin/upgrade.php'));
-
-require_once(ABSPATH . 'wp-admin/admin-functions.php');
-require_once(ABSPATH . 'wp-admin/admin-db.php');
-require_once(ABSPATH . WPINC . '/registration-functions.php');
+require_once(ABSPATH . 'wp-admin/includes/admin.php');
auth_redirect();
@@ -17,96 +59,160 @@ nocache_headers();
update_category_cache();
-wp_get_current_user();
-
-$posts_per_page = get_settings('posts_per_page');
-$what_to_show = get_settings('what_to_show');
-$date_format = get_settings('date_format');
-$time_format = get_settings('time_format');
-
-$wpvarstoreset = array('profile','redirect','redirect_url','a','popuptitle','popupurl','text', 'trackback', 'pingback');
-for ($i=0; $iflush_rules(false);
+
exit();
+} else {
+ do_action("load-$pagenow");
+ // Backwards compatibility with old load-page-new.php, load-page.php,
+ // and load-categories.php actions.
+ if ( $typenow == 'page' ) {
+ if ( $pagenow == 'post-new.php' )
+ do_action( 'load-page-new.php' );
+ elseif ( $pagenow == 'post.php' )
+ do_action( 'load-page.php' );
+ } elseif ( $taxnow == 'category' && $pagenow == 'edit-tags.php' ) {
+ do_action( 'load-categories.php' );
+ }
}
+if ( !empty($_REQUEST['action']) )
+ do_action('admin_action_' . $_REQUEST['action']);
+
?>