当然wp_install_defaults()
是一个可插入的函数。(wp\\u new\\u blog\\u notification()和wp\\u upgrade(),以防您也需要覆盖它们。)
# in wp-config.php
if ( defined(\'WP_INSTALLING\') && WP_INSTALLING ) {
include_once dirname(__FILE__) . \'/wp-content/install.php\';
}
# in wp-content/install.php
function wp_install_defaults($user_id) {
global $wpdb, $wp_rewrite, $current_site, $table_prefix;
// do whatever you want here...
}