bp_core_install_nonmember_opt_outs()

Install database tables to store opt-out requests from nonmembers.


Source Source

File: bp-core/admin/bp-core-admin-schema.php

function bp_core_install_nonmember_opt_outs() {
	$sql             = array();
	$charset_collate = $GLOBALS['wpdb']->get_charset_collate();
	$bp_prefix       = bp_core_get_table_prefix();
	$optouts_class   = new BP_Optout();
	$table_name      = $optouts_class->get_table_name();
	$sql = "CREATE TABLE {$table_name} (
		id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
		email_address_hash varchar(255) NOT NULL,
		user_id bigint(20) NOT NULL,
		email_type varchar(255) NOT NULL,
		date_modified datetime NOT NULL,
		KEY user_id (user_id),
		KEY email_type (email_type),
		KEY date_modified (date_modified)
		) {$charset_collate};";
	dbDelta( $sql );

	/**
	 * Fires after BuddyPress adds the nonmember opt-outs table.
	 *
	 * @since 8.0.0
	 */
	do_action( 'bp_core_install_nonmember_opt_outs' );
}


Top ↑

Changelog Changelog

Changelog
Version Description
8.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.