PluginProbe
HTTP Headers / 1.14.0
HTTP Headers v1.14.0
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 1.14.0, at views/content-type.php

68 lines 2.8 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 _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 </th>
10 <td>
11 <fieldset>
12 <legend class="screen-reader-text">Content-Type</legend>
13 <?php
14 $content_type = get_option('hh_content_type', 0);
15 foreach ($bools as $k => $v)
16 {
17 ?><p><label><input type="radio" class="http-header" name="hh_content_type" value="<?php echo $k; ?>"<?php checked($content_type, $k); ?> /> <?php echo $v; ?></label></p><?php
18 }
19 ?>
20 </fieldset>
21 </td>
22 <td>
23 <?php settings_fields('http-headers-cty'); ?>
24 <?php do_settings_sections('http-headers-cty'); ?>
25 <?php
26 $content_type_value = get_option('hh_content_type_value');
27 if (!$content_type_value) {
28 $content_type_value = array();
29 }
30
31 $map = array(
32 'eot' => 'application/vnd.ms-fontobject',
33 'otf' => 'application/x-font-opentype',
34 'svg' => 'image/svg+xml',
35 'ttf' => 'application/x-font-ttf',
36 'woff' => 'application/font-woff',
37 'woff2' => 'application/font-woff2',
38 'jsonp' => 'application/javascript',
39 );
40 ?>
41 <table>
42 <tbody>
43 <tr>
44 <td></td>
45 <td><strong><?php _e('Extension', 'http-headers'); ?></strong></td>
46 <td><strong><?php _e('Media type', 'http-headers'); ?></strong></td>
47 </tr>
48 <?php
49 foreach ($map as $ext => $media_type)
50 {
51 ?>
52 <tr>
53 <td>
54 <input type="checkbox" class="http-header-value"
55 name="hh_content_type_value[<?php echo $ext; ?>]"
56 value="<?php echo $media_type; ?>"<?php
57 echo !(array_key_exists($ext, $content_type_value) && $content_type_value[$ext] == $media_type) ? NULL : ' checked';
58 echo $content_type == 1 ? NULL : ' readonly'; ?>></td>
59 <td>.<?php echo $ext; ?></td>
60 <td><?php echo $media_type; ?></td>
61 </tr>
62 <?php
63 }
64 ?>
65 </tbody>
66 </table>
67 </td>
68 </tr>