PluginProbe
HTTP Headers / 1.10.2
HTTP Headers v1.10.2
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 / custom-headers.php

custom-headers.php in HTTP Headers 1.10.2, at views/custom-headers.php

83 lines 2.7 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">Custom headers
8 <p class="description"><?php _e('Common non-standard response fields:', 'http-headers'); ?>
9 <br>X-Pingback
10 <br>X-Cache
11 <br>X-Edge-Location
12 <br>X-HTTP-Method-Override
13 <br>X-Csrf-Token
14 <br>X-Request-ID
15 <br>X-Correlation-ID
16 <br>X-Content-Duration
17 <br>X-Robots-Tag
18 </p>
19 </th>
20 <td>
21 <fieldset>
22 <legend class="screen-reader-text">Custom headers</legend>
23 <?php
24 $custom_headers = get_option('hh_custom_headers', 0);
25 foreach ($bools as $k => $v)
26 {
27 ?><p><label><input type="radio" class="http-header" name="hh_custom_headers" value="<?php echo $k; ?>"<?php checked($custom_headers, $k); ?> /> <?php echo $v; ?></label></p><?php
28 }
29 ?>
30 </fieldset>
31 </td>
32 <td>
33 <?php settings_fields( 'http-headers-che' ); ?>
34 <?php do_settings_sections( 'http-headers-che' ); ?>
35 <?php
36 $custom_headers_value = get_option('hh_custom_headers_value');
37 if (!$custom_headers_value) {
38 $custom_headers_value = array();
39 }
40 ?>
41 <table>
42 <thead>
43 <tr>
44 <th><?php _e('Header', 'http-headers'); ?></th>
45 <th><?php _e('Value', 'http-headers'); ?></th>
46 <th></th>
47 </tr>
48 </thead>
49 <tbody>
50 <?php
51 if (empty($custom_headers_value))
52 {
53 ?>
54 <tr>
55 <td><input type="text" name="hh_custom_headers_value[name][]" class="http-header-value" placeholder="X-Custom-Name"></td>
56 <td><input type="text" name="hh_custom_headers_value[value][]" class="http-header-value" placeholder="<?php esc_attr_e('Value', 'http-headers'); ?>"></td>
57 <td></td>
58 </tr>
59 <?php
60 } else {
61 foreach ($custom_headers_value['name'] as $key => $name)
62 {
63 if (empty($name) || empty($custom_headers_value['value'][$key]))
64 {
65 continue;
66 }
67 ?>
68 <tr>
69 <td><input type="text" name="hh_custom_headers_value[name][]" class="http-header-value" placeholder="X-Custom-Name" value="<?php echo esc_attr($name); ?>"<?php echo $custom_headers == 1 ? NULL : ' readonly'; ?>></td>
70 <td><input type="text" name="hh_custom_headers_value[value][]" class="http-header-value" placeholder="<?php esc_attr_e('Value', 'http-headers'); ?>" value="<?php echo esc_attr($custom_headers_value['value'][$key]); ?>"<?php echo $custom_headers == 1 ? NULL : ' readonly'; ?>></td>
71 <td><button type="button" class="button button-small hh-btn-delete-header" title="<?php esc_attr_e('Delete', 'http-headers'); ?>">x</button></td>
72 </tr>
73 <?php
74 }
75 }
76 ?>
77 <tr>
78 <td colspan="3"><button type="button" class="button" id="hh-btn-add-header">+ <?php _e('Add header', 'http-headers'); ?></button></td>
79 </tr>
80 </tbody>
81 </table>
82 </td>
83 </tr>