| 1 |
<?php |
| 2 |
if (!defined('ABSPATH')) { |
| 3 |
exit; |
| 4 |
} |
| 5 |
?> |
| 6 |
<tr> |
| 7 |
<th scope="row">Clear-Site-Data |
| 8 |
<p class="description"><?php _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 |
</th> |
| 10 |
<td> |
| 11 |
<fieldset> |
| 12 |
<legend class="screen-reader-text">Clear-Site-Data</legend> |
| 13 |
<?php |
| 14 |
$clear_site_data = get_option('hh_clear_site_data', 0); |
| 15 |
foreach ($bools as $k => $v) |
| 16 |
{ |
| 17 |
?><p><label><input type="radio" class="http-header" name="hh_clear_site_data" value="<?php echo $k; ?>"<?php checked($clear_site_data, $k); ?> /> <?php echo $v; ?></label></p><?php |
| 18 |
} |
| 19 |
?> |
| 20 |
</fieldset> |
| 21 |
</td> |
| 22 |
<td> |
| 23 |
<?php settings_fields( 'http-headers-csd' ); ?> |
| 24 |
<?php do_settings_sections( 'http-headers-csd' ); ?> |
| 25 |
<?php |
| 26 |
$items = array( |
| 27 |
'cache' => 'bool', |
| 28 |
'cookies' => 'bool', |
| 29 |
'storage' => 'bool', |
| 30 |
'executionContexts' => 'bool', |
| 31 |
'*' => 'bool', |
| 32 |
); |
| 33 |
?> |
| 34 |
<table> |
| 35 |
<?php |
| 36 |
$clear_site_data_value = get_option('hh_clear_site_data_value'); |
| 37 |
if (!$clear_site_data_value) |
| 38 |
{ |
| 39 |
$clear_site_data_value = array(); |
| 40 |
} |
| 41 |
foreach ($items as $item => $type) |
| 42 |
{ |
| 43 |
?> |
| 44 |
<tr> |
| 45 |
<td><label for="hh_clear_site_data_value_<?php echo $item; ?>">"<?php echo $item; ?>"</label></td> |
| 46 |
<td><?php |
| 47 |
switch ($type) { |
| 48 |
case 'bool': |
| 49 |
?><input type="checkbox" class="http-header-value" name="hh_clear_site_data_value[<?php echo $item; ?>]" id="hh_clear_site_data_value_<?php echo $item; ?>" value="1"<?php checked(array_key_exists($item, $clear_site_data_value), 1, true); ?>><?php |
| 50 |
break; |
| 51 |
} |
| 52 |
?> |
| 53 |
</td> |
| 54 |
</tr> |
| 55 |
<?php |
| 56 |
} |
| 57 |
?> |
| 58 |
</table> |
| 59 |
</td> |
| 60 |
</tr> |