populate_site_meta
Filter HookDescription
Filters meta for a site on creation.Hook Information
File Location |
wp-admin/includes/schema.php
View on GitHub
|
Hook Type | Filter |
Line Number | 1345 |
Hook Parameters
Type | Name | Description |
---|---|---|
array
|
$meta
|
Associative array of site meta keys and values to be inserted. |
int
|
$site_id
|
ID of site to populate. |
Usage Examples
Basic Usage
<?php
// Hook into populate_site_meta
add_filter('populate_site_meta', 'my_custom_filter', 10, 2);
function my_custom_filter($meta, $site_id) {
// Your custom filtering logic here
return $meta;
}
Source Code Context
wp-admin/includes/schema.php:1345
- How this hook is used in WordPress core
<?php
1340 * @since 5.2.0
1341 *
1342 * @param array $meta Associative array of site meta keys and values to be inserted.
1343 * @param int $site_id ID of site to populate.
1344 */
1345 $site_meta = apply_filters( 'populate_site_meta', $meta, $site_id );
1346
1347 $insert = '';
1348 foreach ( $site_meta as $meta_key => $meta_value ) {
1349 if ( is_array( $meta_value ) ) {
1350 $meta_value = serialize( $meta_value );
PHP Documentation
<?php
/**
* Filters meta for a site on creation.
*
* @since 5.2.0
*
* @param array $meta Associative array of site meta keys and values to be inserted.
* @param int $site_id ID of site to populate.
*/
Quick Info
- Hook Type: Filter
- Parameters: 2
- File: wp-admin/includes/schema.php
Related Hooks
Related hooks will be displayed here in future updates.