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
309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 | 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.