bp_core_install_extended_profiles()
Install database tables for the Profiles component.
Description
Source
File: bp-core/admin/bp-core-admin-schema.php
function bp_core_install_extended_profiles() {
$sql = array();
$charset_collate = $GLOBALS['wpdb']->get_charset_collate();
$bp_prefix = bp_core_get_table_prefix();
$sql[] = "CREATE TABLE {$bp_prefix}bp_xprofile_groups (
id bigint(20) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY,
name varchar(150) NOT NULL,
description mediumtext NOT NULL,
group_order bigint(20) NOT NULL DEFAULT '0',
can_delete tinyint(1) NOT NULL,
KEY can_delete (can_delete)
) {$charset_collate};";
$sql[] = "CREATE TABLE {$bp_prefix}bp_xprofile_fields (
id bigint(20) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY,
group_id bigint(20) unsigned NOT NULL,
parent_id bigint(20) unsigned NOT NULL,
type varchar(150) NOT NULL,
name varchar(150) NOT NULL,
description longtext NOT NULL,
is_required tinyint(1) NOT NULL DEFAULT '0',
is_default_option tinyint(1) NOT NULL DEFAULT '0',
field_order bigint(20) NOT NULL DEFAULT '0',
option_order bigint(20) NOT NULL DEFAULT '0',
order_by varchar(15) NOT NULL DEFAULT '',
can_delete tinyint(1) NOT NULL DEFAULT '1',
KEY group_id (group_id),
KEY parent_id (parent_id),
KEY field_order (field_order),
KEY can_delete (can_delete),
KEY is_required (is_required)
) {$charset_collate};";
$sql[] = "CREATE TABLE {$bp_prefix}bp_xprofile_data (
id bigint(20) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY,
field_id bigint(20) unsigned NOT NULL,
user_id bigint(20) unsigned NOT NULL,
value longtext NOT NULL,
last_updated datetime NOT NULL,
KEY field_id (field_id),
KEY user_id (user_id)
) {$charset_collate};";
$sql[] = "CREATE TABLE {$bp_prefix}bp_xprofile_meta (
id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
object_id bigint(20) NOT NULL,
object_type varchar(150) NOT NULL,
meta_key varchar(255) DEFAULT NULL,
meta_value longtext DEFAULT NULL,
KEY object_id (object_id),
KEY meta_key (meta_key(191))
) {$charset_collate};";
dbDelta( $sql );
bp_core_install_default_profiles_fields();
}
Changelog
| Version | Description |
|---|---|
| BuddyPress 1.0.0 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.