diff --git a/src/wp-admin/includes/file.php b/src/wp-admin/includes/file.php
index 2018f831b3..4baa331411 100644
a
|
b
|
function wp_print_request_filesystem_credentials_modal() { |
2133 | 2133 | * @return string The HTML for this group and its items. |
2134 | 2134 | */ |
2135 | 2135 | function wp_privacy_generate_personal_data_export_group_html( $group_data ) { |
2136 | | $group_html = '<h2>' . esc_html( $group_data['group_label'] ) . '</h2>'; |
| 2136 | $group_label = esc_html( $group_data['group_label'] ); |
| 2137 | |
| 2138 | $group_html = '<h2 id="' . str_replace( ' ', '_', $group_label ) . '">' . $group_label . '</h2>'; |
2137 | 2139 | $group_html .= '<div>'; |
2138 | 2140 | |
2139 | 2141 | foreach ( (array) $group_data['items'] as $group_item_id => $group_item_data ) { |
… |
… |
function wp_privacy_generate_personal_data_export_group_html( $group_data ) { |
2157 | 2159 | $group_html .= '</table>'; |
2158 | 2160 | } |
2159 | 2161 | |
| 2162 | $group_html .= '<div class="return_to_table_of_contents">'; |
| 2163 | $group_html .= '<a href="#table_of_contents">' . esc_html__( 'Return to table of contents' ) . '</a>'; |
| 2164 | $group_html .= '</div>'; |
| 2165 | |
2160 | 2166 | $group_html .= '</div>'; |
2161 | 2167 | |
2162 | 2168 | return $group_html; |
… |
… |
function wp_privacy_generate_personal_data_export_file( $request_id ) { |
2236 | 2242 | fwrite( $file, 'th { padding: 5px; text-align: left; width: 20%; }' ); |
2237 | 2243 | fwrite( $file, 'td { padding: 5px; }' ); |
2238 | 2244 | fwrite( $file, 'tr:nth-child(odd) { background-color: #fafafa; }' ); |
| 2245 | fwrite( $file, '#table_of_contents { padding: 10px 0 10px 0; }' ); |
| 2246 | fwrite( $file, '.return_to_table_of_contents { text-align:right; }' ); |
2239 | 2247 | fwrite( $file, '</style>' ); |
2240 | 2248 | fwrite( $file, '<title>' ); |
2241 | 2249 | fwrite( $file, esc_html( $title ) ); |
… |
… |
function wp_privacy_generate_personal_data_export_file( $request_id ) { |
2280 | 2288 | // Merge in the special about group. |
2281 | 2289 | $groups = array_merge( array( 'about' => $about_group ), $groups ); |
2282 | 2290 | |
| 2291 | // Create TOC |
| 2292 | fwrite( $file, '<div id="table_of_contents">' ); |
| 2293 | |
| 2294 | $group_count = count( $groups ); |
| 2295 | |
| 2296 | foreach ( (array) $groups as $group_id => $group_data ) { |
| 2297 | $group_label = $group_data['group_label']; |
| 2298 | |
| 2299 | fwrite( $file, '<a href="#' . str_replace( ' ', '_', $group_label ) . '">' . $group_label . '</a>' ); |
| 2300 | |
| 2301 | if ( $group_count > 1 ) { |
| 2302 | fwrite( $file, ' | ' ); |
| 2303 | } |
| 2304 | |
| 2305 | $group_count--; |
| 2306 | } |
| 2307 | |
| 2308 | fwrite( $file, '</div>' ); |
| 2309 | |
2283 | 2310 | // Now, iterate over every group in $groups and have the formatter render it in HTML. |
2284 | 2311 | foreach ( (array) $groups as $group_id => $group_data ) { |
2285 | 2312 | fwrite( $file, wp_privacy_generate_personal_data_export_group_html( $group_data ) ); |