wpmu_signup_blog( string $domain, string $path, string $title, string $user, string $user_email, array $meta = array() )
- Since
- MU (3.0.0)
- Source
wp-includes/ms-functions.php:802
Compatibility
- WordPress
- since MU (3.0.0)
- PHP
- 7.4–8.6-dev
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0), and compiles on PHP 7.4 through 8.6-dev.
Parameters
$domainstring- The requested domain.
$pathstring- The requested path.
$titlestring- The requested site title.
$userstring- The user's requested login name.
$user_emailstring- The user's email address.
$metaarrayoptional- Signup meta data. By default, contains the requested privacy setting and lang_id.Default:
array()
Performance profile
How much work a call to wpmu_signup_blog() does, and what it touches: the algorithmic scaling, the Zend instruction count per call across PHP versions, the hooks it hands control to, and the core code that calls it. Measured from the compiled opcodes, not a stopwatch, so every number is identical on any machine running the same PHP version, and every function in core is ranked by cost.
- Cost class
- Moderate
- Scaling
- Constant
- Instructions
- 61
- Plugin surface
- 2 hooks
- Called by
- 1
Reads stored settings via get_option(), cached per request but not free on a cold cache.
No loop in the body: the same number of instructions runs whatever you pass in.
Executed per call on PHP 8.5. The body compiles to 61.
Third-party callbacks on 'signup_site_meta', 'after_signup_site' run inside this call, and their cost is not bounded by anything here.
1 place in core call this, so the cost is paid more often than your own code shows.
What it touches
- hookthird-party callbacks
apply_filters()called directly - serializeserialisation
serialize()called directly - transienttransient
get_transient()one call below wpmu_signup_blog() - optionoption read or write
get_option()one call below wpmu_signup_blog()
Further down the call graph this can also reach cache and query. Those are the worst case, several calls deep and usually down an error path, not what a normal call pays.
What one call costs · 1 distinct outcome
One number would be a lie: the work depends on which branch runs. These are every distinct cost wpmu_signup_blog() can have, taken from its control-flow graph on PHP 8.5.
| When | Instructions | Calls it makes |
|---|---|---|
| always | 61 | time(), wp_rand(), md5(), apply_filters(), current_time(), serialize(), domain(), do_action() |
Across PHP versions
| PHP | Compiled | Executed | Branches | Notes |
|---|---|---|---|---|
| 8.6-dev | 61 | 61 | 0 | |
| 8.5 | 61 | 61 | 0 | |
| 8.4 | 61 | 61 | 0 | 4 fewer instructions than PHP 8.3 |
| 8.3 | 65 | 65 | 0 | |
| 8.2 | 65 | 65 | 0 | |
| 8.1 | 65 | 65 | 0 | |
| 7.4 | 65 | 65 | 0 |
An instruction is not a fixed amount of time, so a matching count is not necessarily the same speed; what it rules out is a difference in the work itself.
Hooks and filters fired · 2
2 hooks fire while wpmu_signup_blog() runs, in this order:
- apply_filters( signup_site_meta )filterline 822 (+20 into the body)
Filters the metadata for a site signup.
- do_action( after_signup_site )actionline 851 (+49 into the body)
Fires after site signup information has been written to the database.
Uses · 4
- wp_rand()Generates a random non-negative number.
- apply_filters()Calls the callback functions that have been added to a filter hook.
- current_time()Retrieves the current time based on specified type.
- do_action()Calls the callback functions that have been added to an action hook.
Used by · 1
- validate_blog_signup()Validates new site signup.
Source code
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 );}Changelog
Introduced in MU (3.0.0). Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 7.1.0 tag, from
src/wp-includes/ms-functions.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it. - Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.