BP_Optout::_insert( array $data = array(), array $data_format = array() )

Create an opt-out entry.

Parameters Parameters


(array) (Optional) Array of optout data, passed to wpdb::insert().

  • 'email_address'
    (string) The hashed email address of the user that wishes to opt out of communications from this site.
  • 'user_id'
    (int) The ID of the user that generated the contact that resulted in the opt-out.
  • 'email_type'
    (string) The type of email contact that resulted in the opt-out.
  • 'date_modified'
    (string) Date the opt-out was last modified.

Default value: array()


(array) (Optional) See wpdb::insert().

Default value: array()

Top ↑

Return Return

(int|false) The number of rows inserted, or false on error.

Source Source

File: bp-core/classes/class-bp-optout.php

	protected static function _insert( $data = array(), $data_format = array() ) {
		global $wpdb;
		// We must lowercase and hash the email address at insert.
		$email                      = strtolower( $data['email_address_hash'] );
		$data['email_address_hash'] = wp_hash( $email );
		return $wpdb->insert( BP_Optout::get_table_name(), $data, $data_format );

Top ↑

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.