PluginProbe
HTTP Headers / trunk
HTTP Headers vtrunk
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 / content-type.php

content-type.php in HTTP Headers trunk, at views/content-type.php

72 lines 3.5 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">Content-Type
8 <p class="description"><?php esc_html_e('The Content-Type entity header is used to indicate the media type of the resource. In responses, a Content-Type header tells the client what the content type of the returned content actually is. Browsers will do MIME sniffing in some cases and will not necessarily follow the value of this header; to prevent this behavior, the header X-Content-Type-Options can be set to nosniff.', '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/Content-Type"><?php esc_html_e('MDN Web Docs', 'http-headers'); ?></a>
12 </p>
13 </th>
14 <td>
15 <fieldset>
16 <legend class="screen-reader-text">Content-Type</legend>
17 <?php
18 $http_headers_content_type = get_option('hh_content_type', 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_content_type" value="<?php echo esc_attr($http_headers_k); ?>"<?php checked($http_headers_content_type, $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-cty'); ?>
28 <?php do_settings_sections('http-headers-cty'); ?>
29 <?php
30 $http_headers_content_type_value = get_option('hh_content_type_value');
31 if (!$http_headers_content_type_value) {
32 $http_headers_content_type_value = array();
33 }
34
35 $http_headers_map = array(
36 'eot' => 'application/vnd.ms-fontobject',
37 'otf' => 'application/x-font-opentype',
38 'svg' => 'image/svg+xml',
39 'ttf' => 'application/x-font-ttf',
40 'woff' => 'application/font-woff',
41 'woff2' => 'application/font-woff2',
42 'jsonp' => 'application/javascript',
43 );
44 ?>
45 <table>
46 <tbody>
47 <tr>
48 <td></td>
49 <td><strong><?php esc_html_e('Extension', 'http-headers'); ?></strong></td>
50 <td><strong><?php esc_html_e('Media type', 'http-headers'); ?></strong></td>
51 </tr>
52 <?php
53 foreach ($http_headers_map as $http_headers_ext => $http_headers_media_type)
54 {
55 ?>
56 <tr>
57 <td>
58 <input type="checkbox" class="http-header-value"
59 name="hh_content_type_value[<?php echo esc_attr($http_headers_ext); ?>]"
60 value="<?php echo esc_attr($http_headers_media_type); ?>"<?php
61 echo !(array_key_exists($http_headers_ext, $http_headers_content_type_value) && $http_headers_content_type_value[$http_headers_ext] == $http_headers_media_type) ? NULL : ' checked';
62 echo $http_headers_content_type == 1 ? NULL : ' readonly'; ?>></td>
63 <td>.<?php echo esc_html($http_headers_ext); ?></td>
64 <td><?php echo esc_html($http_headers_media_type); ?></td>
65 </tr>
66 <?php
67 }
68 ?>
69 </tbody>
70 </table>
71 </td>
72 </tr>