wp_privacy_additional_user_profile_data хук-фильтрWP 5.4.0

Filters the user's profile data for the privacy exporter.

Использование

add_filter( 'wp_privacy_additional_user_profile_data', 'wp_kama_privacy_additional_user_profile_data_filter', 10, 3 );

/**
 * Function for `wp_privacy_additional_user_profile_data` filter-hook.
 * 
 * @param array    $additional_user_profile_data An array of name-value pairs of additional user data items.
 * @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.
 *
 * @return array
 */
function wp_kama_privacy_additional_user_profile_data_filter( $additional_user_profile_data, $user, $reserved_names ){

	// filter...
	return $additional_user_profile_data;
}
$additional_user_profile_data(массив)

An array of name-value pairs of additional user data items.

По умолчанию: empty array

  • name(строка)
    The user-facing name of an item name-value pair,e.g. 'IP Address'.

  • value(строка)
    The user-facing value of an item data pair, e.g. '50.60.70.0'.
$user(WP_User)
The user whose data is being exported.
$reserved_names(string[])
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.

Список изменений

С версии 5.4.0 Введена.

Где вызывается хук

wp_user_personal_data_exporter()
wp_privacy_additional_user_profile_data
wp-includes/user.php 3904
$_extra_data = apply_filters( 'wp_privacy_additional_user_profile_data', array(), $user, $reserved_names );

Где используется хук в WordPress

Использование не найдено.