confirm_another_blog_signup( string $domain, string $path, string $blog_title, string $user_name, string $user_email = '', array $meta = array(), int $blog_id = 0 )
- Since
- MU (3.0.0), 4.4.0
- Source
wp-signup.php:536
Compatibility
- WordPress
- since 4.4.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 domain URL.
$pathstring- The site root path.
$blog_titlestring- The site title.
$user_namestring- The username.
$user_emailstringoptional- The user's email address.Default:
'' $metaarrayoptional- Any additional meta from the 'add_signup_meta' filter in validate_blog_signup().Default:
array() $blog_idintoptional- The site ID.Default:
0
Performance profile
How much work a call to confirm_another_blog_signup() 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
- Light
- Scaling
- Constant
- Instructions
- 60–68
- Plugin surface
- 1 hook
- Called by
- 1
Only touches the object cache, via wp_cache_switch_to_blog().
No loop in the body: the same number of instructions runs whatever you pass in.
Executed per call on PHP 8.5, depending on the branch taken. The body compiles to 73.
Third-party callbacks on 'signup_finished' 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
do_action()called directly - cacheobject cache
wp_cache_switch_to_blog()one call below confirm_another_blog_signup()
Further down the call graph this can also reach option, serialize, query and transient. Those are the worst case, several calls deep and usually down an error path, not what a normal call pays.
What one call costs · 2 distinct outcomes
One number would be a lie: the work depends on which branch runs. These are every distinct cost confirm_another_blog_signup() can have, taken from its control-flow graph on PHP 8.5.
| When | Instructions | Calls it makes |
|---|---|---|
| always | 60 | esc_url(), sprintf(), __(), printf(), __(), esc_url(), untrailingslashit(), esc_url(), printf(), do_action() |
| always | 68 | switch_to_blog(), home_url(), wp_login_url(), restore_current_blog(), esc_url(), sprintf(), __(), printf(), __(), esc_url(), untrailingslashit(), esc_url(), printf(), do_action() |
Across PHP versions
Compiles the same on PHP 7.4, 8.1, 8.2, 8.3, 8.4, 8.5 and 8.6-dev: 73 instructions, 60–68 executed per call, 1 branch. The work does not change between versions.
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 · 1
One hook fires while confirm_another_blog_signup() runs, in this order:
- do_action( signup_finished )actionline 582 (+46 into the body)
Fires when the site or user sign-up process is complete.
Uses · 8
- switch_to_blog()Switches the current blog.
- home_url()Retrieves the URL for the current site where the front end is accessible.
- wp_login_url()Retrieves the login URL.
- restore_current_blog()Restores the current blog, after calling switch_to_blog().
- esc_url()Checks and cleans a URL.
- __()Retrieves the translation of $text.
- untrailingslashit()Removes trailing forward slashes and backslashes if they exist.
- do_action()Calls the callback functions that have been added to an action hook.
Used by · 1
- validate_another_blog_signup()Validates a new site sign-up for an existing user.
Source code
function confirm_another_blog_signup( $domain, $path, $blog_title, $user_name, $user_email = '', $meta = array(), $blog_id = 0 ) { if ( $blog_id ) { switch_to_blog( $blog_id ); $home_url = home_url( '/' ); $login_url = wp_login_url(); restore_current_blog(); } else { $home_url = 'http://' . $domain . $path; $login_url = 'http://' . $domain . $path . 'wp-login.php'; } $site = sprintf( '<a href="%1$s">%2$s</a>', esc_url( $home_url ), $blog_title ); ?> <h2> <?php /* translators: %s: Site title. */ printf( __( 'The site %s is yours.' ), $site ); ?> </h2> <p> <?php printf( /* translators: 1: Link to new site, 2: Login URL, 3: Username. */ __( '%1$s is your new site. <a href="%2$s">Log in</a> as “%3$s” using your existing password.' ), sprintf( '<a href="%s">%s</a>', esc_url( $home_url ), untrailingslashit( $domain . $path ) ), esc_url( $login_url ), $user_name ); ?> </p> <?php /** * Fires when the site or user sign-up process is complete. * * @since 3.0.0 */ do_action( 'signup_finished' );}Changelog
Introduced in 4.4.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
$blog_id parameter.from the docblockAbout this page
- Parsed data
- Generated from the wordpress-develop 7.1.0 tag, from
src/wp-signup.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.