Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.
wp_set_wpdb_vars() WordPress Function
The wp_set_wpdb_vars() function allows you to set the database variables for a WordPress site. This function is useful for when you need to change the database settings for a WordPress site.
wp_set_wpdb_vars() #
Set the database table prefix and the format specifiers for database table columns.
Description
Columns not listed here default to %s
.
Source
File: wp-includes/load.php
function wp_set_wpdb_vars() { global $wpdb, $table_prefix; if ( ! empty( $wpdb->error ) ) { dead_db(); } $wpdb->field_types = array( 'post_author' => '%d', 'post_parent' => '%d', 'menu_order' => '%d', 'term_id' => '%d', 'term_group' => '%d', 'term_taxonomy_id' => '%d', 'parent' => '%d', 'count' => '%d', 'object_id' => '%d', 'term_order' => '%d', 'ID' => '%d', 'comment_ID' => '%d', 'comment_post_ID' => '%d', 'comment_parent' => '%d', 'user_id' => '%d', 'link_id' => '%d', 'link_owner' => '%d', 'link_rating' => '%d', 'option_id' => '%d', 'blog_id' => '%d', 'meta_id' => '%d', 'post_id' => '%d', 'user_status' => '%d', 'umeta_id' => '%d', 'comment_karma' => '%d', 'comment_count' => '%d', // Multisite: 'active' => '%d', 'cat_id' => '%d', 'deleted' => '%d', 'lang_id' => '%d', 'mature' => '%d', 'public' => '%d', 'site_id' => '%d', 'spam' => '%d', ); $prefix = $wpdb->set_prefix( $table_prefix ); if ( is_wp_error( $prefix ) ) { wp_load_translations_early(); wp_die( sprintf( /* translators: 1: $table_prefix, 2: wp-config.php */ __( '<strong>Error</strong>: %1$s in %2$s can only contain numbers, letters, and underscores.' ), '<code>$table_prefix</code>', '<code>wp-config.php</code>' ) ); } }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
3.0.0 | Introduced. |