On this page
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
$errorsWP_Error-
Error object to add validation errors to.
$dataarray-
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.
domainstringSite domain. Default empty string.pathstringSite path. Default'/'.network_idintThe site's network ID. Default is the current network ID.registeredstringWhen the site was registered, in SQL datetime format. Default is the current time.last_updatedstringWhen the site was last updated, in SQL datetime format. Default is the value of $registered.publicintWhether the site is public. Default 1.archivedintWhether the site is archived. Default 0.matureintWhether the site is mature. Default 0.spamintWhether the site is spam. Default 0.deletedintWhether the site is deleted. Default 0.lang_idintThe site's language ID. Currently unused. Default 0.user_idintUser ID for the site administrator. Passed to thewp_initialize_sitehook.titlestringSite title. Default is 'Site %d' where %d is the site ID. Passed to thewp_initialize_sitehook.optionsarrayCustom option $key => $value pairs to use. Default empty array. Passed to thewp_initialize_sitehook.metaarrayCustom site metadata $key => $value pairs to use. Default empty array.
Passed to thewp_initialize_sitehook.
$old_siteWP_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 );
Related
Used By
| Used By | Description |
|---|---|
| wp_prepare_site_data() wp-includes/ms-site.php | Prepares site data for insertion or update in the database. |
Changelog
| Version | Description |
|---|---|
| 5.1.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/wp_validate_site_data