On this page
wpmu_signup_blog( string $domain, string $path, string $title, string $user, string $user_email, array $meta = array() )
Records site signup information for future activation.
Parameters
$domainstring Required-
The requested domain.
$pathstring Required-
The requested path.
$titlestring Required-
The requested site title.
$userstring Required-
The user's requested login name.
$user_emailstring Required-
The user's email address.
$metaarray Optional-
Signup meta data. By default, contains the requested privacy setting and lang_id.
Default:
array()
Source
File: wp-includes/ms-functions.php. View all references
function wpmu_signup_blog( $domain, $path, $title, $user, $user_email, $meta = array() ) {
global $wpdb;
$key = substr( md5( time() . wp_rand() . $domain ), 0, 16 );
/**
* Filters the metadata for a site signup.
*
* The metadata will be serialized prior to storing it in the database.
*
* @since 4.8.0
*
* @param array $meta Signup meta data. Default empty array.
* @param string $domain The requested domain.
* @param string $path The requested path.
* @param string $title The requested site title.
* @param string $user The user's requested login name.
* @param string $user_email The user's email address.
* @param string $key The user's activation key.
*/
$meta = apply_filters( 'signup_site_meta', $meta, $domain, $path, $title, $user, $user_email, $key );
$wpdb->insert(
$wpdb->signups,
array(
'domain' => $domain,
'path' => $path,
'title' => $title,
'user_login' => $user,
'user_email' => $user_email,
'registered' => current_time( 'mysql', true ),
'activation_key' => $key,
'meta' => serialize( $meta ),
)
);
/**
* Fires after site signup information has been written to the database.
*
* @since 4.4.0
*
* @param string $domain The requested domain.
* @param string $path The requested path.
* @param string $title The requested site title.
* @param string $user The user's requested login name.
* @param string $user_email The user's email address.
* @param string $key The user's activation key.
* @param array $meta Signup meta data. By default, contains the requested privacy setting and lang_id.
*/
do_action( 'after_signup_site', $domain, $path, $title, $user, $user_email, $key, $meta );
}
Hooks
- do_action( 'after_signup_site',
string $domain ,string $path ,string $title ,string $user ,string $user_email ,string $key ,array $meta ) -
Fires after site signup information has been written to the database.
- apply_filters( 'signup_site_meta',
array $meta ,string $domain ,string $path ,string $title ,string $user ,string $user_email ,string $key ) -
Filters the metadata for a site signup.
Related
Uses
| Uses | Description |
|---|---|
| wp_rand() wp-includes/pluggable.php | Generates a random non-negative number. |
| current_time() wp-includes/functions.php | Retrieves the current time based on specified type. |
| wpdb::insert() wp-includes/class-wpdb.php | Inserts a row into the table. |
| apply_filters() wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| do_action() wp-includes/plugin.php | Calls the callback functions that have been added to an action hook. |
Used By
| Used By | Description |
|---|---|
| validate_blog_signup() wp-signup.php | Validates new site signup. |
Changelog
| Version | Description |
|---|---|
| MU (3.0.0) | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wpmu_signup_blog