WordPress at a glance
function is not described

wp_privacy_generate_personal_data_export_group_html() WP 4.9.6

Generate a single group for the personal data export report.

No Hooks.

Return

String. The HTML for this group and its items.

Usage

wp_privacy_generate_personal_data_export_group_html( $group_data );
$group_data(array) (required)

The group data to render.

  • $group_label (string)
    The user-facing heading for the group, e.g. 'Comments'.

  • $items (array)
    An array of group items.

    • $group_item_data (array)
      An array of name-value pairs for the item.

      • $name (string)
        The user-facing name of an item name-value pair, e.g. 'IP Address'.

      • $value (string)
        The user-facing value of an item data pair, e.g. '50.60.70.0'.

Changelog

Since 4.9.6 Introduced.

Code of wp privacy generate personal data export group html: wp-admin/includes/file.php WP 5.2.2

<?php
function wp_privacy_generate_personal_data_export_group_html( $group_data ) {
	$group_html  = '<h2>' . esc_html( $group_data['group_label'] ) . '</h2>';
	$group_html .= '<div>';

	foreach ( (array) $group_data['items'] as $group_item_id => $group_item_data ) {
		$group_html .= '<table>';
		$group_html .= '<tbody>';

		foreach ( (array) $group_item_data as $group_item_datum ) {
			$value = $group_item_datum['value'];
			// If it looks like a link, make it a link.
			if ( false === strpos( $value, ' ' ) && ( 0 === strpos( $value, 'http://' ) || 0 === strpos( $value, 'https://' ) ) ) {
				$value = '<a href="' . esc_url( $value ) . '">' . esc_html( $value ) . '</a>';
			}

			$group_html .= '<tr>';
			$group_html .= '<th>' . esc_html( $group_item_datum['name'] ) . '</th>';
			$group_html .= '<td>' . wp_kses( $value, 'personal_data_export' ) . '</td>';
			$group_html .= '</tr>';
		}

		$group_html .= '</tbody>';
		$group_html .= '</table>';
	}

	$group_html .= '</div>';

	return $group_html;
}