Using WordPress ‘confirm_another_blog_signup()’ PHP function

The confirm_another_blog_signup() WordPress PHP function is used to display a message confirming that a new site has been created.

Usage

Here’s a generic usage of the function:

confirm_another_blog_signup('example.com', '/blog', 'My Blog', 'JohnDoe', '[email protected]', array(), 1);

In this example, we’re confirming the creation of a new blog with the domain ‘example.com’, path ‘/blog’, title ‘My Blog’, username ‘JohnDoe’, email ‘[email protected]’, no additional metadata, and site ID 1.

Parameters

  • $domain (string): The domain URL.
  • $path (string): The site root path.
  • $blog_title (string): The site title.
  • $user_name (string): The username.
  • $user_email (string, optional): The user’s email address. Default is an empty string.
  • $meta (array, optional): Any additional meta from the ‘add_signup_meta’ filter in validate_blog_signup(). Default is an empty array.
  • $blog_id (int): The site ID.

More information

See WordPress Developer Resources: confirm_another_blog_signup()

This function is part of the WordPress core, and there is currently no information about it being deprecated.

Examples

Confirming a blog signup

This example shows how to confirm a blog signup with the most basic information.

// The domain of your site
$domain = 'example.com';

// The root path of your site
$path = '/blog';

// The title of your site
$blog_title = 'My Blog';

// The username for the site
$user_name = 'JohnDoe';

// Confirm the blog signup
confirm_another_blog_signup($domain, $path, $blog_title, $user_name);

Confirming a blog signup with email

This example includes the user’s email.

$domain = 'example.com';
$path = '/blog';
$blog_title = 'My Blog';
$user_name = 'JohnDoe';
$user_email = '[email protected]'; // User's email

confirm_another_blog_signup($domain, $path, $blog_title, $user_name, $user_email);

Confirming a blog signup with metadata

This example includes additional metadata.

$domain = 'example.com';
$path = '/blog';
$blog_title = 'My Blog';
$user_name = 'JohnDoe';
$user_email = '[email protected]';
$meta = array('key1' => 'value1', 'key2' => 'value2'); // Additional metadata

confirm_another_blog_signup($domain, $path, $blog_title, $user_name, $user_email, $meta);

Confirming a blog signup with a specified site ID

This example specifies a site ID.

$domain = 'example.com';
$path = '/blog';
$blog_title = 'My Blog';
$user_name = 'JohnDoe';
$user_email = '[email protected]';
$meta = array();
$blog_id = 1; // Site ID

confirm_another_blog_signup($domain, $path, $blog_title, $user_name, $user_email, $meta, $blog_id);