Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: wp_privacy_additional_user_profile_data

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
3039       *     An array of name-value pairs of additional user data items. Default empty array.
3040       *
3041       *     @type string $name  The user-facing name of an item name-value pair,e.g. 'IP Address'.
3042       *     @type string $value The user-facing value of an item data pair, e.g. '50.60.70.0'.
3043       * }
3044       * @param WP_User  $user           The user whose data is being exported.
3045       * @param string[] $reserved_names An array of reserved names. Any item in `$additional_user_data`
3046       *                                 that uses one of these for its `name` will not be included in the export.
3047       */
3048      $_extra_data = apply_filters( 'wp_privacy_additional_user_profile_data', array(), $user, $reserved_names );
3049
3050      if ( is_array( $_extra_data ) && ! empty( $_extra_data ) ) {
3051           // Remove items that use reserved names.
3052           $extra_data = array_filter(
3053                $_extra_data,
3054                function( $item ) use ( $reserved_names ) {
3055                     return ! in_array( $item['name'], $reserved_names, true );
3056                }
3057           );