PluginProbe
HTTP Headers / 1.12.1
HTTP Headers v1.12.1
1.19.5 trunk 1.0.0 1.1.0 1.1.1 1.1.2 1.10.0 1.10.1 1.10.2 1.10.3 1.10.4 1.10.5 1.11.0 1.12.0 1.12.1 1.12.2 1.13.0 1.13.1 1.13.2 1.13.3 1.13.4 1.14.0 1.14.1 1.14.2 1.15.0 All 60 releases
http-headers / views / cache-control.php

cache-control.php in HTTP Headers 1.12.1, at views/cache-control.php

67 lines 2.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if (!defined('ABSPATH')) {
3 exit;
4 }
5 ?>
6 <tr>
7 <th scope="row">Cache-Control
8 <p class="description"><?php _e('The Cache-Control general-header field is used to specify directives for caching mechanisms in both, requests and responses. Caching directives are unidirectional, meaning that a given directive in a request is not implying that the same directive is to be given in the response.', 'http-headers'); ?></p>
9 </th>
10 <td>
11 <fieldset>
12 <legend class="screen-reader-text">Cache-Control</legend>
13 <?php
14 $cache_control = get_option('hh_cache_control', 0);
15 foreach ($bools as $k => $v)
16 {
17 ?><p><label><input type="radio" class="http-header" name="hh_cache_control" value="<?php echo $k; ?>"<?php checked($cache_control, $k); ?> /> <?php echo $v; ?></label></p><?php
18 }
19 ?>
20 </fieldset>
21 </td>
22 <td>
23 <?php settings_fields( 'http-headers-cc' ); ?>
24 <?php do_settings_sections( 'http-headers-cc' ); ?>
25 <?php
26 $items = array(
27 'must-revalidate' => 'bool',
28 'no-cache' => 'bool',
29 'no-store' => 'bool',
30 'no-transform' => 'bool',
31 'public' => 'bool',
32 'private' => 'bool',
33 'proxy-revalidate' => 'bool',
34 'max-age' => 'int',
35 's-maxage' => 'int',
36 );
37 ?>
38 <table>
39 <?php
40 $cache_control_value = get_option('hh_cache_control_value');
41 if (!$cache_control_value)
42 {
43 $cache_control_value = array();
44 }
45 foreach ($items as $item => $type)
46 {
47 ?>
48 <tr>
49 <td><label for="hh_cache_control_value_<?php echo $item; ?>"><?php echo $item; ?></label></td>
50 <td><?php
51 switch ($type) {
52 case 'bool':
53 ?><input type="checkbox" class="http-header-value" name="hh_cache_control_value[<?php echo $item; ?>]" id="hh_cache_control_value_<?php echo $item; ?>" value="1"<?php checked(array_key_exists($item, $cache_control_value), 1, true); ?>><?php
54 break;
55 case 'int':
56 ?><input type="text" class="http-header-value" name="hh_cache_control_value[<?php echo $item; ?>]" id="hh_cache_control_value_<?php echo $item; ?>" size="6" value="<?php echo array_key_exists($item, $cache_control_value) && strlen($cache_control_value[$item]) > 0 ? (int) $cache_control_value[$item] : NULL; ?>"> <?php _e('seconds', 'http-headers');
57 break;
58 }
59 ?>
60 </td>
61 </tr>
62 <?php
63 }
64 ?>
65 </table>
66 </td>
67 </tr>