wp_validate_site_data WordPress Action Hook

The wp_validate_site_data hook is used to validate site data before it is saved to the database. This hook is used by the wp_insert_site and wp_update_site functions.

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.


Top ↑

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.

$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.


Top ↑

Source

File: wp-includes/ms-site.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
5.1.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.