wp_privacy_additional_user_profile_data
Filter HookDescription
Filters the user's profile data for the privacy exporter. }Hook Information
File Location |
wp-includes/user.php
View on GitHub
|
Hook Type | Filter |
Line Number | 4025 |
Hook Parameters
Type | Name | Description |
---|---|---|
array
|
$additional_user_profile_data
|
{ An array of name-value pairs of additional user data items. Default empty array. |
WP_User
|
$user
|
The user whose data is being exported. |
string[]
|
$reserved_names
|
An array of reserved names. Any item in `$additional_user_data` that uses one of these for its `name` will not be included in the export. |
Usage Examples
Basic Usage
<?php
// Hook into wp_privacy_additional_user_profile_data
add_filter('wp_privacy_additional_user_profile_data', 'my_custom_filter', 10, 3);
function my_custom_filter($additional_user_profile_data, $user, $reserved_names) {
// Your custom filtering logic here
return $additional_user_profile_data;
}
Source Code Context
wp-includes/user.php:4025
- How this hook is used in WordPress core
<?php
4020 * }
4021 * @param WP_User $user The user whose data is being exported.
4022 * @param string[] $reserved_names An array of reserved names. Any item in `$additional_user_data`
4023 * that uses one of these for its `name` will not be included in the export.
4024 */
4025 $_extra_data = apply_filters( 'wp_privacy_additional_user_profile_data', array(), $user, $reserved_names );
4026
4027 if ( is_array( $_extra_data ) && ! empty( $_extra_data ) ) {
4028 // Remove items that use reserved names.
4029 $extra_data = array_filter(
4030 $_extra_data,
PHP Documentation
<?php
/**
* Filters the user's profile data for the privacy exporter.
*
* @since 5.4.0
*
* @param array $additional_user_profile_data {
* An array of name-value pairs of additional user data items. Default empty array.
*
* @type string $name The user-facing name of an item name-value pair,e.g. 'IP Address'.
* @type string $value The user-facing value of an item data pair, e.g. '50.60.70.0'.
* }
* @param WP_User $user The user whose data is being exported.
* @param string[] $reserved_names An array of reserved names. Any item in `$additional_user_data`
* that uses one of these for its `name` will not be included in the export.
*/
Quick Info
- Hook Type: Filter
- Parameters: 3
- File: wp-includes/user.php
Related Hooks
Related hooks will be displayed here in future updates.