wp_normalize_site_data
Filter HookDescription
Filters passed site data in order to normalize it.Hook Information
File Location |
wp-includes/ms-site.php
View on GitHub
|
Hook Type | Filter |
Line Number | 482 |
Hook Parameters
Type | Name | Description |
---|---|---|
array
|
$data
|
Associative array of site data passed to the respective function. See {@see wp_insert_site()} for the possibly included data. |
Usage Examples
Basic Usage
<?php
// Hook into wp_normalize_site_data
add_filter('wp_normalize_site_data', 'my_custom_filter', 10, 1);
function my_custom_filter($data) {
// Your custom filtering logic here
return $data;
}
Source Code Context
wp-includes/ms-site.php:482
- How this hook is used in WordPress core
<?php
477 * @since 5.1.0
478 *
479 * @param array $data Associative array of site data passed to the respective function.
480 * See {@see wp_insert_site()} for the possibly included data.
481 */
482 $data = apply_filters( 'wp_normalize_site_data', $data );
483
484 $allowed_data_fields = array( 'domain', 'path', 'network_id', 'registered', 'last_updated', 'public', 'archived', 'mature', 'spam', 'deleted', 'lang_id' );
485 $data = array_intersect_key( wp_parse_args( $data, $defaults ), array_flip( $allowed_data_fields ) );
486
487 $errors = new WP_Error();
PHP Documentation
<?php
/**
* Filters passed site data in order to normalize it.
*
* @since 5.1.0
*
* @param array $data Associative array of site data passed to the respective function.
* See {@see wp_insert_site()} for the possibly included data.
*/
Quick Info
- Hook Type: Filter
- Parameters: 1
- File: wp-includes/ms-site.php
Related Hooks
Related hooks will be displayed here in future updates.