Edit File by line
/home/barbar84/public_h.../wp-admin/includes
File: schema.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* WordPress Administration Scheme API
[2] Fix | Delete
*
[3] Fix | Delete
* Here we keep the DB structure and option values.
[4] Fix | Delete
*
[5] Fix | Delete
* @package WordPress
[6] Fix | Delete
* @subpackage Administration
[7] Fix | Delete
*/
[8] Fix | Delete
[9] Fix | Delete
/**
[10] Fix | Delete
* Declare these as global in case schema.php is included from a function.
[11] Fix | Delete
*
[12] Fix | Delete
* @global wpdb $wpdb WordPress database abstraction object.
[13] Fix | Delete
* @global array $wp_queries
[14] Fix | Delete
* @global string $charset_collate
[15] Fix | Delete
*/
[16] Fix | Delete
global $wpdb, $wp_queries, $charset_collate;
[17] Fix | Delete
[18] Fix | Delete
/**
[19] Fix | Delete
* The database character collate.
[20] Fix | Delete
*/
[21] Fix | Delete
$charset_collate = $wpdb->get_charset_collate();
[22] Fix | Delete
[23] Fix | Delete
/**
[24] Fix | Delete
* Retrieve the SQL for creating database tables.
[25] Fix | Delete
*
[26] Fix | Delete
* @since 3.3.0
[27] Fix | Delete
*
[28] Fix | Delete
* @global wpdb $wpdb WordPress database abstraction object.
[29] Fix | Delete
*
[30] Fix | Delete
* @param string $scope Optional. The tables for which to retrieve SQL. Can be all, global, ms_global, or blog tables. Defaults to all.
[31] Fix | Delete
* @param int $blog_id Optional. The site ID for which to retrieve SQL. Default is the current site ID.
[32] Fix | Delete
* @return string The SQL needed to create the requested tables.
[33] Fix | Delete
*/
[34] Fix | Delete
function wp_get_db_schema( $scope = 'all', $blog_id = null ) {
[35] Fix | Delete
global $wpdb;
[36] Fix | Delete
[37] Fix | Delete
$charset_collate = $wpdb->get_charset_collate();
[38] Fix | Delete
[39] Fix | Delete
if ( $blog_id && $blog_id != $wpdb->blogid ) {
[40] Fix | Delete
$old_blog_id = $wpdb->set_blog_id( $blog_id );
[41] Fix | Delete
}
[42] Fix | Delete
[43] Fix | Delete
// Engage multisite if in the middle of turning it on from network.php.
[44] Fix | Delete
$is_multisite = is_multisite() || ( defined( 'WP_INSTALLING_NETWORK' ) && WP_INSTALLING_NETWORK );
[45] Fix | Delete
[46] Fix | Delete
/*
[47] Fix | Delete
* Indexes have a maximum size of 767 bytes. Historically, we haven't need to be concerned about that.
[48] Fix | Delete
* As of 4.2, however, we moved to utf8mb4, which uses 4 bytes per character. This means that an index which
[49] Fix | Delete
* used to have room for floor(767/3) = 255 characters, now only has room for floor(767/4) = 191 characters.
[50] Fix | Delete
*/
[51] Fix | Delete
$max_index_length = 191;
[52] Fix | Delete
[53] Fix | Delete
// Blog-specific tables.
[54] Fix | Delete
$blog_tables = "CREATE TABLE $wpdb->termmeta (
[55] Fix | Delete
meta_id bigint(20) unsigned NOT NULL auto_increment,
[56] Fix | Delete
term_id bigint(20) unsigned NOT NULL default '0',
[57] Fix | Delete
meta_key varchar(255) default NULL,
[58] Fix | Delete
meta_value longtext,
[59] Fix | Delete
PRIMARY KEY (meta_id),
[60] Fix | Delete
KEY term_id (term_id),
[61] Fix | Delete
KEY meta_key (meta_key($max_index_length))
[62] Fix | Delete
) $charset_collate;
[63] Fix | Delete
CREATE TABLE $wpdb->terms (
[64] Fix | Delete
term_id bigint(20) unsigned NOT NULL auto_increment,
[65] Fix | Delete
name varchar(200) NOT NULL default '',
[66] Fix | Delete
slug varchar(200) NOT NULL default '',
[67] Fix | Delete
term_group bigint(10) NOT NULL default 0,
[68] Fix | Delete
PRIMARY KEY (term_id),
[69] Fix | Delete
KEY slug (slug($max_index_length)),
[70] Fix | Delete
KEY name (name($max_index_length))
[71] Fix | Delete
) $charset_collate;
[72] Fix | Delete
CREATE TABLE $wpdb->term_taxonomy (
[73] Fix | Delete
term_taxonomy_id bigint(20) unsigned NOT NULL auto_increment,
[74] Fix | Delete
term_id bigint(20) unsigned NOT NULL default 0,
[75] Fix | Delete
taxonomy varchar(32) NOT NULL default '',
[76] Fix | Delete
description longtext NOT NULL,
[77] Fix | Delete
parent bigint(20) unsigned NOT NULL default 0,
[78] Fix | Delete
count bigint(20) NOT NULL default 0,
[79] Fix | Delete
PRIMARY KEY (term_taxonomy_id),
[80] Fix | Delete
UNIQUE KEY term_id_taxonomy (term_id,taxonomy),
[81] Fix | Delete
KEY taxonomy (taxonomy)
[82] Fix | Delete
) $charset_collate;
[83] Fix | Delete
CREATE TABLE $wpdb->term_relationships (
[84] Fix | Delete
object_id bigint(20) unsigned NOT NULL default 0,
[85] Fix | Delete
term_taxonomy_id bigint(20) unsigned NOT NULL default 0,
[86] Fix | Delete
term_order int(11) NOT NULL default 0,
[87] Fix | Delete
PRIMARY KEY (object_id,term_taxonomy_id),
[88] Fix | Delete
KEY term_taxonomy_id (term_taxonomy_id)
[89] Fix | Delete
) $charset_collate;
[90] Fix | Delete
CREATE TABLE $wpdb->commentmeta (
[91] Fix | Delete
meta_id bigint(20) unsigned NOT NULL auto_increment,
[92] Fix | Delete
comment_id bigint(20) unsigned NOT NULL default '0',
[93] Fix | Delete
meta_key varchar(255) default NULL,
[94] Fix | Delete
meta_value longtext,
[95] Fix | Delete
PRIMARY KEY (meta_id),
[96] Fix | Delete
KEY comment_id (comment_id),
[97] Fix | Delete
KEY meta_key (meta_key($max_index_length))
[98] Fix | Delete
) $charset_collate;
[99] Fix | Delete
CREATE TABLE $wpdb->comments (
[100] Fix | Delete
comment_ID bigint(20) unsigned NOT NULL auto_increment,
[101] Fix | Delete
comment_post_ID bigint(20) unsigned NOT NULL default '0',
[102] Fix | Delete
comment_author tinytext NOT NULL,
[103] Fix | Delete
comment_author_email varchar(100) NOT NULL default '',
[104] Fix | Delete
comment_author_url varchar(200) NOT NULL default '',
[105] Fix | Delete
comment_author_IP varchar(100) NOT NULL default '',
[106] Fix | Delete
comment_date datetime NOT NULL default '0000-00-00 00:00:00',
[107] Fix | Delete
comment_date_gmt datetime NOT NULL default '0000-00-00 00:00:00',
[108] Fix | Delete
comment_content text NOT NULL,
[109] Fix | Delete
comment_karma int(11) NOT NULL default '0',
[110] Fix | Delete
comment_approved varchar(20) NOT NULL default '1',
[111] Fix | Delete
comment_agent varchar(255) NOT NULL default '',
[112] Fix | Delete
comment_type varchar(20) NOT NULL default 'comment',
[113] Fix | Delete
comment_parent bigint(20) unsigned NOT NULL default '0',
[114] Fix | Delete
user_id bigint(20) unsigned NOT NULL default '0',
[115] Fix | Delete
PRIMARY KEY (comment_ID),
[116] Fix | Delete
KEY comment_post_ID (comment_post_ID),
[117] Fix | Delete
KEY comment_approved_date_gmt (comment_approved,comment_date_gmt),
[118] Fix | Delete
KEY comment_date_gmt (comment_date_gmt),
[119] Fix | Delete
KEY comment_parent (comment_parent),
[120] Fix | Delete
KEY comment_author_email (comment_author_email(10))
[121] Fix | Delete
) $charset_collate;
[122] Fix | Delete
CREATE TABLE $wpdb->links (
[123] Fix | Delete
link_id bigint(20) unsigned NOT NULL auto_increment,
[124] Fix | Delete
link_url varchar(255) NOT NULL default '',
[125] Fix | Delete
link_name varchar(255) NOT NULL default '',
[126] Fix | Delete
link_image varchar(255) NOT NULL default '',
[127] Fix | Delete
link_target varchar(25) NOT NULL default '',
[128] Fix | Delete
link_description varchar(255) NOT NULL default '',
[129] Fix | Delete
link_visible varchar(20) NOT NULL default 'Y',
[130] Fix | Delete
link_owner bigint(20) unsigned NOT NULL default '1',
[131] Fix | Delete
link_rating int(11) NOT NULL default '0',
[132] Fix | Delete
link_updated datetime NOT NULL default '0000-00-00 00:00:00',
[133] Fix | Delete
link_rel varchar(255) NOT NULL default '',
[134] Fix | Delete
link_notes mediumtext NOT NULL,
[135] Fix | Delete
link_rss varchar(255) NOT NULL default '',
[136] Fix | Delete
PRIMARY KEY (link_id),
[137] Fix | Delete
KEY link_visible (link_visible)
[138] Fix | Delete
) $charset_collate;
[139] Fix | Delete
CREATE TABLE $wpdb->options (
[140] Fix | Delete
option_id bigint(20) unsigned NOT NULL auto_increment,
[141] Fix | Delete
option_name varchar(191) NOT NULL default '',
[142] Fix | Delete
option_value longtext NOT NULL,
[143] Fix | Delete
autoload varchar(20) NOT NULL default 'yes',
[144] Fix | Delete
PRIMARY KEY (option_id),
[145] Fix | Delete
UNIQUE KEY option_name (option_name),
[146] Fix | Delete
KEY autoload (autoload)
[147] Fix | Delete
) $charset_collate;
[148] Fix | Delete
CREATE TABLE $wpdb->postmeta (
[149] Fix | Delete
meta_id bigint(20) unsigned NOT NULL auto_increment,
[150] Fix | Delete
post_id bigint(20) unsigned NOT NULL default '0',
[151] Fix | Delete
meta_key varchar(255) default NULL,
[152] Fix | Delete
meta_value longtext,
[153] Fix | Delete
PRIMARY KEY (meta_id),
[154] Fix | Delete
KEY post_id (post_id),
[155] Fix | Delete
KEY meta_key (meta_key($max_index_length))
[156] Fix | Delete
) $charset_collate;
[157] Fix | Delete
CREATE TABLE $wpdb->posts (
[158] Fix | Delete
ID bigint(20) unsigned NOT NULL auto_increment,
[159] Fix | Delete
post_author bigint(20) unsigned NOT NULL default '0',
[160] Fix | Delete
post_date datetime NOT NULL default '0000-00-00 00:00:00',
[161] Fix | Delete
post_date_gmt datetime NOT NULL default '0000-00-00 00:00:00',
[162] Fix | Delete
post_content longtext NOT NULL,
[163] Fix | Delete
post_title text NOT NULL,
[164] Fix | Delete
post_excerpt text NOT NULL,
[165] Fix | Delete
post_status varchar(20) NOT NULL default 'publish',
[166] Fix | Delete
comment_status varchar(20) NOT NULL default 'open',
[167] Fix | Delete
ping_status varchar(20) NOT NULL default 'open',
[168] Fix | Delete
post_password varchar(255) NOT NULL default '',
[169] Fix | Delete
post_name varchar(200) NOT NULL default '',
[170] Fix | Delete
to_ping text NOT NULL,
[171] Fix | Delete
pinged text NOT NULL,
[172] Fix | Delete
post_modified datetime NOT NULL default '0000-00-00 00:00:00',
[173] Fix | Delete
post_modified_gmt datetime NOT NULL default '0000-00-00 00:00:00',
[174] Fix | Delete
post_content_filtered longtext NOT NULL,
[175] Fix | Delete
post_parent bigint(20) unsigned NOT NULL default '0',
[176] Fix | Delete
guid varchar(255) NOT NULL default '',
[177] Fix | Delete
menu_order int(11) NOT NULL default '0',
[178] Fix | Delete
post_type varchar(20) NOT NULL default 'post',
[179] Fix | Delete
post_mime_type varchar(100) NOT NULL default '',
[180] Fix | Delete
comment_count bigint(20) NOT NULL default '0',
[181] Fix | Delete
PRIMARY KEY (ID),
[182] Fix | Delete
KEY post_name (post_name($max_index_length)),
[183] Fix | Delete
KEY type_status_date (post_type,post_status,post_date,ID),
[184] Fix | Delete
KEY post_parent (post_parent),
[185] Fix | Delete
KEY post_author (post_author)
[186] Fix | Delete
) $charset_collate;\n";
[187] Fix | Delete
[188] Fix | Delete
// Single site users table. The multisite flavor of the users table is handled below.
[189] Fix | Delete
$users_single_table = "CREATE TABLE $wpdb->users (
[190] Fix | Delete
ID bigint(20) unsigned NOT NULL auto_increment,
[191] Fix | Delete
user_login varchar(60) NOT NULL default '',
[192] Fix | Delete
user_pass varchar(255) NOT NULL default '',
[193] Fix | Delete
user_nicename varchar(50) NOT NULL default '',
[194] Fix | Delete
user_email varchar(100) NOT NULL default '',
[195] Fix | Delete
user_url varchar(100) NOT NULL default '',
[196] Fix | Delete
user_registered datetime NOT NULL default '0000-00-00 00:00:00',
[197] Fix | Delete
user_activation_key varchar(255) NOT NULL default '',
[198] Fix | Delete
user_status int(11) NOT NULL default '0',
[199] Fix | Delete
display_name varchar(250) NOT NULL default '',
[200] Fix | Delete
PRIMARY KEY (ID),
[201] Fix | Delete
KEY user_login_key (user_login),
[202] Fix | Delete
KEY user_nicename (user_nicename),
[203] Fix | Delete
KEY user_email (user_email)
[204] Fix | Delete
) $charset_collate;\n";
[205] Fix | Delete
[206] Fix | Delete
// Multisite users table.
[207] Fix | Delete
$users_multi_table = "CREATE TABLE $wpdb->users (
[208] Fix | Delete
ID bigint(20) unsigned NOT NULL auto_increment,
[209] Fix | Delete
user_login varchar(60) NOT NULL default '',
[210] Fix | Delete
user_pass varchar(255) NOT NULL default '',
[211] Fix | Delete
user_nicename varchar(50) NOT NULL default '',
[212] Fix | Delete
user_email varchar(100) NOT NULL default '',
[213] Fix | Delete
user_url varchar(100) NOT NULL default '',
[214] Fix | Delete
user_registered datetime NOT NULL default '0000-00-00 00:00:00',
[215] Fix | Delete
user_activation_key varchar(255) NOT NULL default '',
[216] Fix | Delete
user_status int(11) NOT NULL default '0',
[217] Fix | Delete
display_name varchar(250) NOT NULL default '',
[218] Fix | Delete
spam tinyint(2) NOT NULL default '0',
[219] Fix | Delete
deleted tinyint(2) NOT NULL default '0',
[220] Fix | Delete
PRIMARY KEY (ID),
[221] Fix | Delete
KEY user_login_key (user_login),
[222] Fix | Delete
KEY user_nicename (user_nicename),
[223] Fix | Delete
KEY user_email (user_email)
[224] Fix | Delete
) $charset_collate;\n";
[225] Fix | Delete
[226] Fix | Delete
// Usermeta.
[227] Fix | Delete
$usermeta_table = "CREATE TABLE $wpdb->usermeta (
[228] Fix | Delete
umeta_id bigint(20) unsigned NOT NULL auto_increment,
[229] Fix | Delete
user_id bigint(20) unsigned NOT NULL default '0',
[230] Fix | Delete
meta_key varchar(255) default NULL,
[231] Fix | Delete
meta_value longtext,
[232] Fix | Delete
PRIMARY KEY (umeta_id),
[233] Fix | Delete
KEY user_id (user_id),
[234] Fix | Delete
KEY meta_key (meta_key($max_index_length))
[235] Fix | Delete
) $charset_collate;\n";
[236] Fix | Delete
[237] Fix | Delete
// Global tables.
[238] Fix | Delete
if ( $is_multisite ) {
[239] Fix | Delete
$global_tables = $users_multi_table . $usermeta_table;
[240] Fix | Delete
} else {
[241] Fix | Delete
$global_tables = $users_single_table . $usermeta_table;
[242] Fix | Delete
}
[243] Fix | Delete
[244] Fix | Delete
// Multisite global tables.
[245] Fix | Delete
$ms_global_tables = "CREATE TABLE $wpdb->blogs (
[246] Fix | Delete
blog_id bigint(20) NOT NULL auto_increment,
[247] Fix | Delete
site_id bigint(20) NOT NULL default '0',
[248] Fix | Delete
domain varchar(200) NOT NULL default '',
[249] Fix | Delete
path varchar(100) NOT NULL default '',
[250] Fix | Delete
registered datetime NOT NULL default '0000-00-00 00:00:00',
[251] Fix | Delete
last_updated datetime NOT NULL default '0000-00-00 00:00:00',
[252] Fix | Delete
public tinyint(2) NOT NULL default '1',
[253] Fix | Delete
archived tinyint(2) NOT NULL default '0',
[254] Fix | Delete
mature tinyint(2) NOT NULL default '0',
[255] Fix | Delete
spam tinyint(2) NOT NULL default '0',
[256] Fix | Delete
deleted tinyint(2) NOT NULL default '0',
[257] Fix | Delete
lang_id int(11) NOT NULL default '0',
[258] Fix | Delete
PRIMARY KEY (blog_id),
[259] Fix | Delete
KEY domain (domain(50),path(5)),
[260] Fix | Delete
KEY lang_id (lang_id)
[261] Fix | Delete
) $charset_collate;
[262] Fix | Delete
CREATE TABLE $wpdb->blogmeta (
[263] Fix | Delete
meta_id bigint(20) unsigned NOT NULL auto_increment,
[264] Fix | Delete
blog_id bigint(20) NOT NULL default '0',
[265] Fix | Delete
meta_key varchar(255) default NULL,
[266] Fix | Delete
meta_value longtext,
[267] Fix | Delete
PRIMARY KEY (meta_id),
[268] Fix | Delete
KEY meta_key (meta_key($max_index_length)),
[269] Fix | Delete
KEY blog_id (blog_id)
[270] Fix | Delete
) $charset_collate;
[271] Fix | Delete
CREATE TABLE $wpdb->registration_log (
[272] Fix | Delete
ID bigint(20) NOT NULL auto_increment,
[273] Fix | Delete
email varchar(255) NOT NULL default '',
[274] Fix | Delete
IP varchar(30) NOT NULL default '',
[275] Fix | Delete
blog_id bigint(20) NOT NULL default '0',
[276] Fix | Delete
date_registered datetime NOT NULL default '0000-00-00 00:00:00',
[277] Fix | Delete
PRIMARY KEY (ID),
[278] Fix | Delete
KEY IP (IP)
[279] Fix | Delete
) $charset_collate;
[280] Fix | Delete
CREATE TABLE $wpdb->site (
[281] Fix | Delete
id bigint(20) NOT NULL auto_increment,
[282] Fix | Delete
domain varchar(200) NOT NULL default '',
[283] Fix | Delete
path varchar(100) NOT NULL default '',
[284] Fix | Delete
PRIMARY KEY (id),
[285] Fix | Delete
KEY domain (domain(140),path(51))
[286] Fix | Delete
) $charset_collate;
[287] Fix | Delete
CREATE TABLE $wpdb->sitemeta (
[288] Fix | Delete
meta_id bigint(20) NOT NULL auto_increment,
[289] Fix | Delete
site_id bigint(20) NOT NULL default '0',
[290] Fix | Delete
meta_key varchar(255) default NULL,
[291] Fix | Delete
meta_value longtext,
[292] Fix | Delete
PRIMARY KEY (meta_id),
[293] Fix | Delete
KEY meta_key (meta_key($max_index_length)),
[294] Fix | Delete
KEY site_id (site_id)
[295] Fix | Delete
) $charset_collate;
[296] Fix | Delete
CREATE TABLE $wpdb->signups (
[297] Fix | Delete
signup_id bigint(20) NOT NULL auto_increment,
[298] Fix | Delete
domain varchar(200) NOT NULL default '',
[299] Fix | Delete
path varchar(100) NOT NULL default '',
[300] Fix | Delete
title longtext NOT NULL,
[301] Fix | Delete
user_login varchar(60) NOT NULL default '',
[302] Fix | Delete
user_email varchar(100) NOT NULL default '',
[303] Fix | Delete
registered datetime NOT NULL default '0000-00-00 00:00:00',
[304] Fix | Delete
activated datetime NOT NULL default '0000-00-00 00:00:00',
[305] Fix | Delete
active tinyint(1) NOT NULL default '0',
[306] Fix | Delete
activation_key varchar(50) NOT NULL default '',
[307] Fix | Delete
meta longtext,
[308] Fix | Delete
PRIMARY KEY (signup_id),
[309] Fix | Delete
KEY activation_key (activation_key),
[310] Fix | Delete
KEY user_email (user_email),
[311] Fix | Delete
KEY user_login_email (user_login,user_email),
[312] Fix | Delete
KEY domain_path (domain(140),path(51))
[313] Fix | Delete
) $charset_collate;";
[314] Fix | Delete
[315] Fix | Delete
switch ( $scope ) {
[316] Fix | Delete
case 'blog':
[317] Fix | Delete
$queries = $blog_tables;
[318] Fix | Delete
break;
[319] Fix | Delete
case 'global':
[320] Fix | Delete
$queries = $global_tables;
[321] Fix | Delete
if ( $is_multisite ) {
[322] Fix | Delete
$queries .= $ms_global_tables;
[323] Fix | Delete
}
[324] Fix | Delete
break;
[325] Fix | Delete
case 'ms_global':
[326] Fix | Delete
$queries = $ms_global_tables;
[327] Fix | Delete
break;
[328] Fix | Delete
case 'all':
[329] Fix | Delete
default:
[330] Fix | Delete
$queries = $global_tables . $blog_tables;
[331] Fix | Delete
if ( $is_multisite ) {
[332] Fix | Delete
$queries .= $ms_global_tables;
[333] Fix | Delete
}
[334] Fix | Delete
break;
[335] Fix | Delete
}
[336] Fix | Delete
[337] Fix | Delete
if ( isset( $old_blog_id ) ) {
[338] Fix | Delete
$wpdb->set_blog_id( $old_blog_id );
[339] Fix | Delete
}
[340] Fix | Delete
[341] Fix | Delete
return $queries;
[342] Fix | Delete
}
[343] Fix | Delete
[344] Fix | Delete
// Populate for back compat.
[345] Fix | Delete
$wp_queries = wp_get_db_schema( 'all' );
[346] Fix | Delete
[347] Fix | Delete
/**
[348] Fix | Delete
* Create WordPress options and set the default values.
[349] Fix | Delete
*
[350] Fix | Delete
* @since 1.5.0
[351] Fix | Delete
* @since 5.1.0 The $options parameter has been added.
[352] Fix | Delete
*
[353] Fix | Delete
* @global wpdb $wpdb WordPress database abstraction object.
[354] Fix | Delete
* @global int $wp_db_version WordPress database version.
[355] Fix | Delete
* @global int $wp_current_db_version The old (current) database version.
[356] Fix | Delete
*
[357] Fix | Delete
* @param array $options Optional. Custom option $key => $value pairs to use. Default empty array.
[358] Fix | Delete
*/
[359] Fix | Delete
function populate_options( array $options = array() ) {
[360] Fix | Delete
global $wpdb, $wp_db_version, $wp_current_db_version;
[361] Fix | Delete
[362] Fix | Delete
$guessurl = wp_guess_url();
[363] Fix | Delete
/**
[364] Fix | Delete
* Fires before creating WordPress options and populating their default values.
[365] Fix | Delete
*
[366] Fix | Delete
* @since 2.6.0
[367] Fix | Delete
*/
[368] Fix | Delete
do_action( 'populate_options' );
[369] Fix | Delete
[370] Fix | Delete
// If WP_DEFAULT_THEME doesn't exist, fall back to the latest core default theme.
[371] Fix | Delete
$stylesheet = WP_DEFAULT_THEME;
[372] Fix | Delete
$template = WP_DEFAULT_THEME;
[373] Fix | Delete
$theme = wp_get_theme( WP_DEFAULT_THEME );
[374] Fix | Delete
if ( ! $theme->exists() ) {
[375] Fix | Delete
$theme = WP_Theme::get_core_default_theme();
[376] Fix | Delete
}
[377] Fix | Delete
[378] Fix | Delete
// If we can't find a core default theme, WP_DEFAULT_THEME is the best we can do.
[379] Fix | Delete
if ( $theme ) {
[380] Fix | Delete
$stylesheet = $theme->get_stylesheet();
[381] Fix | Delete
$template = $theme->get_template();
[382] Fix | Delete
}
[383] Fix | Delete
[384] Fix | Delete
$timezone_string = '';
[385] Fix | Delete
$gmt_offset = 0;
[386] Fix | Delete
/*
[387] Fix | Delete
* translators: default GMT offset or timezone string. Must be either a valid offset (-12 to 14)
[388] Fix | Delete
* or a valid timezone string (America/New_York). See https://www.php.net/manual/en/timezones.php
[389] Fix | Delete
* for all timezone strings supported by PHP.
[390] Fix | Delete
*/
[391] Fix | Delete
$offset_or_tz = _x( '0', 'default GMT offset or timezone string' ); // phpcs:ignore WordPress.WP.I18n.NoEmptyStrings
[392] Fix | Delete
if ( is_numeric( $offset_or_tz ) ) {
[393] Fix | Delete
$gmt_offset = $offset_or_tz;
[394] Fix | Delete
} elseif ( $offset_or_tz && in_array( $offset_or_tz, timezone_identifiers_list(), true ) ) {
[395] Fix | Delete
$timezone_string = $offset_or_tz;
[396] Fix | Delete
}
[397] Fix | Delete
[398] Fix | Delete
$defaults = array(
[399] Fix | Delete
'siteurl' => $guessurl,
[400] Fix | Delete
'home' => $guessurl,
[401] Fix | Delete
'blogname' => __( 'My Site' ),
[402] Fix | Delete
/* translators: Site tagline. */
[403] Fix | Delete
'blogdescription' => __( 'Just another WordPress site' ),
[404] Fix | Delete
'users_can_register' => 0,
[405] Fix | Delete
'admin_email' => 'you@example.com',
[406] Fix | Delete
/* translators: Default start of the week. 0 = Sunday, 1 = Monday. */
[407] Fix | Delete
'start_of_week' => _x( '1', 'start of week' ),
[408] Fix | Delete
'use_balanceTags' => 0,
[409] Fix | Delete
'use_smilies' => 1,
[410] Fix | Delete
'require_name_email' => 1,
[411] Fix | Delete
'comments_notify' => 1,
[412] Fix | Delete
'posts_per_rss' => 10,
[413] Fix | Delete
'rss_use_excerpt' => 0,
[414] Fix | Delete
'mailserver_url' => 'mail.example.com',
[415] Fix | Delete
'mailserver_login' => 'login@example.com',
[416] Fix | Delete
'mailserver_pass' => 'password',
[417] Fix | Delete
'mailserver_port' => 110,
[418] Fix | Delete
'default_category' => 1,
[419] Fix | Delete
'default_comment_status' => 'open',
[420] Fix | Delete
'default_ping_status' => 'open',
[421] Fix | Delete
'default_pingback_flag' => 1,
[422] Fix | Delete
'posts_per_page' => 10,
[423] Fix | Delete
/* translators: Default date format, see https://www.php.net/manual/datetime.format.php */
[424] Fix | Delete
'date_format' => __( 'F j, Y' ),
[425] Fix | Delete
/* translators: Default time format, see https://www.php.net/manual/datetime.format.php */
[426] Fix | Delete
'time_format' => __( 'g:i a' ),
[427] Fix | Delete
/* translators: Links last updated date format, see https://www.php.net/manual/datetime.format.php */
[428] Fix | Delete
'links_updated_date_format' => __( 'F j, Y g:i a' ),
[429] Fix | Delete
'comment_moderation' => 0,
[430] Fix | Delete
'moderation_notify' => 1,
[431] Fix | Delete
'permalink_structure' => '',
[432] Fix | Delete
'rewrite_rules' => '',
[433] Fix | Delete
'hack_file' => 0,
[434] Fix | Delete
'blog_charset' => 'UTF-8',
[435] Fix | Delete
'moderation_keys' => '',
[436] Fix | Delete
'active_plugins' => array(),
[437] Fix | Delete
'category_base' => '',
[438] Fix | Delete
'ping_sites' => 'http://rpc.pingomatic.com/',
[439] Fix | Delete
'comment_max_links' => 2,
[440] Fix | Delete
'gmt_offset' => $gmt_offset,
[441] Fix | Delete
[442] Fix | Delete
// 1.5.0
[443] Fix | Delete
'default_email_category' => 1,
[444] Fix | Delete
'recently_edited' => '',
[445] Fix | Delete
'template' => $template,
[446] Fix | Delete
'stylesheet' => $stylesheet,
[447] Fix | Delete
'comment_registration' => 0,
[448] Fix | Delete
'html_type' => 'text/html',
[449] Fix | Delete
[450] Fix | Delete
// 1.5.1
[451] Fix | Delete
'use_trackback' => 0,
[452] Fix | Delete
[453] Fix | Delete
// 2.0.0
[454] Fix | Delete
'default_role' => 'subscriber',
[455] Fix | Delete
'db_version' => $wp_db_version,
[456] Fix | Delete
[457] Fix | Delete
// 2.0.1
[458] Fix | Delete
'uploads_use_yearmonth_folders' => 1,
[459] Fix | Delete
'upload_path' => '',
[460] Fix | Delete
[461] Fix | Delete
// 2.1.0
[462] Fix | Delete
'blog_public' => '1',
[463] Fix | Delete
'default_link_category' => 2,
[464] Fix | Delete
'show_on_front' => 'posts',
[465] Fix | Delete
[466] Fix | Delete
// 2.2.0
[467] Fix | Delete
'tag_base' => '',
[468] Fix | Delete
[469] Fix | Delete
// 2.5.0
[470] Fix | Delete
'show_avatars' => '1',
[471] Fix | Delete
'avatar_rating' => 'G',
[472] Fix | Delete
'upload_url_path' => '',
[473] Fix | Delete
'thumbnail_size_w' => 150,
[474] Fix | Delete
'thumbnail_size_h' => 150,
[475] Fix | Delete
'thumbnail_crop' => 1,
[476] Fix | Delete
'medium_size_w' => 300,
[477] Fix | Delete
'medium_size_h' => 300,
[478] Fix | Delete
[479] Fix | Delete
// 2.6.0
[480] Fix | Delete
'avatar_default' => 'mystery',
[481] Fix | Delete
[482] Fix | Delete
// 2.7.0
[483] Fix | Delete
'large_size_w' => 1024,
[484] Fix | Delete
'large_size_h' => 1024,
[485] Fix | Delete
'image_default_link_type' => 'none',
[486] Fix | Delete
'image_default_size' => '',
[487] Fix | Delete
'image_default_align' => '',
[488] Fix | Delete
'close_comments_for_old_posts' => 0,
[489] Fix | Delete
'close_comments_days_old' => 14,
[490] Fix | Delete
'thread_comments' => 1,
[491] Fix | Delete
'thread_comments_depth' => 5,
[492] Fix | Delete
'page_comments' => 0,
[493] Fix | Delete
'comments_per_page' => 50,
[494] Fix | Delete
'default_comments_page' => 'newest',
[495] Fix | Delete
'comment_order' => 'asc',
[496] Fix | Delete
'sticky_posts' => array(),
[497] Fix | Delete
'widget_categories' => array(),
[498] Fix | Delete
'widget_text' => array(),
[499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function