BP_Signup::add( array $args = array() )
Add a signup.
Description
Parameters
- $args
-
(Optional) Array of arguments for signup addition.
- 'domain'
(string) New user's domain. - 'path'
(string) New user's path. - 'title'
(string) New user's title. - 'user_login'
(string) New user's user_login. - 'user_email'
(string) New user's email address. - 'registered'
(int|string) Time the user registered. - 'activation_key'
(string) New user's activation key. - 'meta'
(string) New user's user meta.
Default value: array()
- 'domain'
Return
(int|bool) ID of newly created signup on success, false on failure.
Source
File: bp-members/classes/class-bp-signup.php
public static function add( $args = array() ) { global $wpdb; $r = bp_parse_args( $args, array( 'domain' => '', 'path' => '', 'title' => '', 'user_login' => '', 'user_email' => '', 'registered' => current_time( 'mysql', true ), 'activation_key' => '', 'meta' => '', ), 'bp_core_signups_add_args' ); $r['meta'] = maybe_serialize( $r['meta'] ); $inserted = $wpdb->insert( buddypress()->members->table_name_signups, $r, array( '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s' ) ); if ( $inserted ) { $retval = $wpdb->insert_id; } else { $retval = false; } /** * Filters the result of a signup addition. * * @since BuddyPress 2.0.0 * * @param int|bool $retval Newly added user ID on success, false on failure. */ return apply_filters( 'bp_core_signups_add', $retval ); }
Changelog
Version | Description |
---|---|
BuddyPress 2.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.