do_action( 'wp_validate_site_data', WP_Error $errors , array $data , WP_Site|null $old_site )
Fires when data should be validated for a site prior to inserting or updating in the database.
Description
Plugins should amend the $errors
object via its WP_Error::add()
method.
Parameters
-
$errors
WP_Error -
Error object to add validation errors to.
-
$data
array -
Associative array of complete site data. See wp_insert_site() for the included data.
More Arguments from wp_insert_site( ... $data )
Data for the new site that should be inserted.
domain
stringSite domain. Default empty string.path
stringSite path. Default'/'
.network_id
intThe site's network ID. Default is the current network ID.registered
stringWhen the site was registered, in SQL datetime format. Default is the current time.last_updated
stringWhen the site was last updated, in SQL datetime format. Default is the value of $registered.public
intWhether the site is public. Default 1.archived
intWhether the site is archived. Default 0.mature
intWhether the site is mature. Default 0.spam
intWhether the site is spam. Default 0.deleted
intWhether the site is deleted. Default 0.lang_id
intThe site's language ID. Currently unused. Default 0.user_id
intUser ID for the site administrator. Passed to thewp_initialize_site
hook.title
stringSite title. Default is 'Site %d' where %d is the site ID. Passed to thewp_initialize_site
hook.options
arrayCustom option $key => $value pairs to use. Default empty array. Passed to thewp_initialize_site
hook.meta
arrayCustom site metadata $key => $value pairs to use. Default empty array.
Passed to thewp_initialize_site
hook.
-
$old_site
WP_Site|null -
The old site object if the data belongs to a site being updated, or null if it is a new site being inserted.
Source
File: wp-includes/ms-site.php
.
View all references
do_action( 'wp_validate_site_data', $errors, $data, $old_site );
Changelog
Version | Description |
---|---|
5.1.0 | Introduced. |