From 18b1b224e83a0f92cab5139b0a65dabbbeb8a4e6 Mon Sep 17 00:00:00 2001 From: scribu Date: Wed, 17 Jul 2013 04:02:37 +0300 Subject: [PATCH] get rid of some DB warnings --- php/wp-settings-cli.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/php/wp-settings-cli.php b/php/wp-settings-cli.php index b40e1479..50687b3d 100644 --- a/php/wp-settings-cli.php +++ b/php/wp-settings-cli.php @@ -59,6 +59,22 @@ require( ABSPATH . WPINC . '/pomo/mo.php' ); // WP_CLI: Early hooks Utils\replace_wp_die_handler(); add_filter( 'wp_redirect', 'WP_CLI\\Utils\\wp_redirect_handler' ); +if ( defined( 'WP_INSTALLING' ) && is_multisite() ) { + $values = array( + 'ms_files_rewriting' => null, + 'active_sitewide_plugins' => array(), + '_site_transient_update_core' => null, + '_site_transient_update_themes' => null, + '_site_transient_update_plugins' => null, + 'WPLANG' => '', + ); + foreach ( $values as $key => $value ) { + add_filter( "pre_site_option_$key", function () use ( $values, $key ) { + return $values[ $key ]; + } ); + } + unset( $values, $key, $value ); +} // Include the wpdb class and, if present, a db.php database drop-in. require_wp_db(); -- 2.11.0