BP_Signup::update( array $args = array() )
Update the meta for a signup.
Description
This is the way we use to "trace" the last date an activation email was sent and how many times activation was sent.
Parameters
- $args
-
(Optional) Array of arguments for the signup update.
- 'signup_id'
(int) User signup ID. - 'meta'
(array) Meta to update.
Default value: array()
- 'signup_id'
Return
(int) The signup id.
Source
File: bp-members/classes/class-bp-signup.php
public static function update( $args = array() ) {
global $wpdb;
$r = bp_parse_args( $args,
array(
'signup_id' => 0,
'meta' => array(),
),
'bp_core_signups_update_args'
);
if ( empty( $r['signup_id'] ) || empty( $r['meta'] ) ) {
return false;
}
$wpdb->update(
// Signups table.
buddypress()->members->table_name_signups,
// Data to update.
array(
'meta' => serialize( $r['meta'] ),
),
// WHERE.
array(
'signup_id' => $r['signup_id'],
),
// Data sanitization format.
array(
'%s',
),
// WHERE sanitization format.
array(
'%d',
)
);
/**
* Filters the signup ID which received a meta update.
*
* @since BuddyPress 2.0.0
*
* @param int $value The signup ID.
*/
return apply_filters( 'bp_core_signups_update', $r['signup_id'] );
}
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.