| 1 |
<?php |
| 2 |
if (!defined('ABSPATH')) { |
| 3 |
exit; |
| 4 |
} |
| 5 |
?> |
| 6 |
<tr> |
| 7 |
<th scope="row">Clear-Site-Data |
| 8 |
<p class="description"><?php esc_html_e('The Clear-Site-Data header clears browsing data (cookies, storage, cache) associated with the requesting website. It allows web developers to have more control over the data stored locally by a browser for their origins.', 'http-headers'); ?></p> |
| 9 |
<hr> |
| 10 |
<p class="description"><?php esc_html_e('Read more at', 'http-headers'); ?> |
| 11 |
<a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Clear-Site-Data"><?php esc_html_e('MDN Web Docs', 'http-headers'); ?></a> |
| 12 |
</p> |
| 13 |
</th> |
| 14 |
<td> |
| 15 |
<fieldset> |
| 16 |
<legend class="screen-reader-text">Clear-Site-Data</legend> |
| 17 |
<?php |
| 18 |
$http_headers_clear_site_data = get_option('hh_clear_site_data', 0); |
| 19 |
foreach ($http_headers_bools as $http_headers_k => $http_headers_v) |
| 20 |
{ |
| 21 |
?><p><label><input type="radio" class="http-header" name="hh_clear_site_data" value="<?php echo esc_attr($http_headers_k); ?>"<?php checked($http_headers_clear_site_data, $http_headers_k); ?> /> <?php echo esc_html($http_headers_v); ?></label></p><?php |
| 22 |
} |
| 23 |
?> |
| 24 |
</fieldset> |
| 25 |
</td> |
| 26 |
<td> |
| 27 |
<?php settings_fields( 'http-headers-csd' ); ?> |
| 28 |
<?php do_settings_sections( 'http-headers-csd' ); ?> |
| 29 |
<?php |
| 30 |
$http_headers_items = array( |
| 31 |
'cache' => 'bool', |
| 32 |
'clientHints' => 'bool', |
| 33 |
'cookies' => 'bool', |
| 34 |
'storage' => 'bool', |
| 35 |
'executionContexts' => 'bool', |
| 36 |
'*' => 'bool', |
| 37 |
); |
| 38 |
?> |
| 39 |
<table> |
| 40 |
<?php |
| 41 |
$http_headers_clear_site_data_value = get_option('hh_clear_site_data_value'); |
| 42 |
if (!$http_headers_clear_site_data_value) |
| 43 |
{ |
| 44 |
$http_headers_clear_site_data_value = array(); |
| 45 |
} |
| 46 |
foreach ($http_headers_items as $http_headers_item => $http_headers_type) |
| 47 |
{ |
| 48 |
?> |
| 49 |
<tr> |
| 50 |
<td><label for="hh_clear_site_data_value_<?php echo esc_attr($http_headers_item); ?>">"<?php echo esc_html($http_headers_item); ?>"</label></td> |
| 51 |
<td><?php |
| 52 |
switch ($http_headers_type) { |
| 53 |
case 'bool': |
| 54 |
?><input type="checkbox" class="http-header-value" name="hh_clear_site_data_value[<?php echo esc_attr($http_headers_item); ?>]" id="hh_clear_site_data_value_<?php echo esc_attr($http_headers_item); ?>" value="1"<?php checked(array_key_exists($http_headers_item, $http_headers_clear_site_data_value), 1, true); ?>><?php |
| 55 |
break; |
| 56 |
} |
| 57 |
?> |
| 58 |
</td> |
| 59 |
</tr> |
| 60 |
<?php |
| 61 |
} |
| 62 |
?> |
| 63 |
</table> |
| 64 |
</td> |
| 65 |
</tr> |