PluginProbe
Catch Web Tools / 3.2
Catch Web Tools v3.2
trunk 0.1 0.2 0.3 0.4 1.0 1.1 1.2 1.3 1.4 1.4.1 1.5 1.5.1 1.5.2 1.6 1.7 1.8 1.8.1 1.9 1.9.1 1.9.2 1.9.3 1.9.4 1.9.5 1.9.6 All 58 releases
catch-web-tools / admin / modules / opengraph.php

opengraph.php in Catch Web Tools 3.2, at admin/modules/opengraph.php

206 lines 12.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 // Exit if accessed directly
4 if (! defined('ABSPATH')) exit;
5
6 /**
7 * @package Admin
8 * @sub-package Admin Opengraph Display
9 */
10 ?>
11 <?php include('header.php'); ?>
12 <div id="opengraph">
13 <div class="content-wrapper">
14 <div class="header">
15 <h3><?php esc_html_e('Opengraph', 'catch-web-tools'); ?></h3>
16 </div> <!-- .header -->
17 <div class="content">
18 <form method="post" action="options.php">
19 <?php settings_fields('opengraph-settings-group'); ?>
20 <?php $settings = catchwebtools_get_options('catchwebtools_opengraph'); ?>
21 <div class="option-container">
22 <h3 class="option-toggle option-active"><a href="#"><?php esc_html_e('Enable Open Graph Module', 'catch-web-tools'); ?></a></h3>
23 <div class="option-content inside open">
24 <table class="form-table">
25 <tbody>
26 <tr>
27 <th scope="row"><?php esc_html_e('Enable Open Graph Module', 'catch-web-tools'); ?></th>
28 <td>
29 <?php
30 $text = (! empty($settings['status']) && $settings['status']) ? 'checked' : '';
31 echo '<input type="checkbox" ' . esc_html($text) . ' name="catchwebtools_opengraph[status]" value="1"/>&nbsp;&nbsp;' . esc_html__('Check to Enable', 'catch-web-tools');
32 echo '<p class="description">' . esc_html__('Add Open Graph meta data to your site\'s <code>&lt;head&gt;</code> section. You can specify some of the IDs that are sometimes needed below:', 'catch-web-tools') . '<p class="description">';
33 echo '<p class="description">' . esc_html__('Open Graph tags for specific Pages or Posts, can be added via Catch Web Tools Custom Meta Box which shows up in Pages\' and Posts\' add/edit sections once this function is enabled.', 'catch-web-tools') . '</p>';
34 ?>
35 </td>
36 </tr>
37 </tbody>
38 </table>
39 <?php submit_button('Save Changes'); ?>
40 </div>
41
42 <h3 class="option-toggle"><a href="#"><?php esc_html_e('Facebook Settings', 'catch-web-tools'); ?></a></h3>
43 <div class="option-content inside">
44 <table class="form-table">
45 <tbody>
46 <tr>
47 <th scope="row"><?php esc_html_e('Facebook App ID', 'catch-web-tools'); ?></th>
48 <td>
49 <?php
50 $text = (! empty($settings['fb:app_id'])) ? esc_attr($settings['fb:app_id']) : '';
51 echo '<input type="text" size="80" name="catchwebtools_opengraph[fb:app_id]" value="' . esc_html($text) . '" />';
52 ?>
53 </td>
54 </tr>
55 </tbody>
56 </table>
57 <?php submit_button('Save Changes'); ?>
58 </div>
59
60
61
62
63 <h3 class="option-toggle"><a href="#"><?php esc_html_e('Homepage Settings', 'catch-web-tools'); ?></a></h3>
64 <div class="option-content inside">
65 <table class="form-table">
66 <tbody>
67 <tr>
68 <th scope="row">
69 <?php esc_html_e('Title', 'catch-web-tools'); ?>
70 </th>
71 <td>
72 <?php
73 $text = (! empty($settings['og:title'])) ? esc_attr($settings['og:title']) : get_bloginfo('name');
74 echo '<input type="text" size="80" name="catchwebtools_opengraph[og:title]" value="' . esc_attr($text) . '" /><p id="description">og:title tag</p>';
75 ?>
76 </td>
77 </tr>
78
79 <tr>
80 <th scope="row">
81 <?php esc_html_e('Type', 'catch-web-tools'); ?>
82 </th>
83 <td>
84 <?php
85 $text = (! empty($settings['og:type'])) ? esc_attr($settings['og:type']) : '';
86 $options = array('website', 'music.song', 'music.radio_station', 'music.playlist', 'music.album', 'video.movie', 'video.tv_show', 'video.episode', 'video.other', 'article', 'book', 'profile');
87 echo '<select name="catchwebtools_opengraph[og:type]" class="catchwebtools_opengraph_type">';
88 echo '<option value="">-</option>';
89 foreach ($options as $option) {
90 echo '<option value="' . esc_attr($option) . '" ';
91 if ($text == $option)
92 echo 'selected="true"';
93 echo '>' . esc_attr($option) . '</option>';
94 }
95 echo '</select><p id="description">og:type tag</p>';
96 ?>
97 </td>
98 </tr>
99
100 <tr>
101 <th scope="row">
102 <?php esc_html_e('URL', 'catch-web-tools'); ?>
103 </th>
104 <td>
105 <?php
106 $text = (! empty($settings['og:url'])) ? esc_attr($settings['og:url']) : home_url();
107 echo '<input type="text" size="80" name="catchwebtools_opengraph[og:url]" value="' . esc_attr($text) . '" /><p id="description">og:url tag</p>';
108 ?>
109 </td>
110 </tr>
111
112 <tr>
113 <th scope="row">
114 <?php esc_html_e('Description', 'catch-web-tools'); ?>
115 </th>
116 <td>
117 <?php
118 $text = (! empty($settings['og:description'])) ? esc_attr($settings['og:description']) : esc_attr(get_bloginfo('description'));
119 echo '<textarea cols="80" rows="7" name="catchwebtools_opengraph[og:description]" >' . esc_attr($text) . '</textarea><p id="description">og:description tag</p>';
120 ?>
121 </td>
122 </tr>
123
124 <tr>
125 <th scope="row">
126 <?php esc_html_e('Sitename', 'catch-web-tools'); ?>
127 </th>
128 <td>
129 <?php
130 $text = (! empty($settings['og:site_name'])) ? esc_attr($settings['og:site_name']) : get_bloginfo('name');
131 echo '<input type="text" size="80" name="catchwebtools_opengraph[og:site_name]" value="' . esc_attr($text) . '" /><p id="description">og:site_name tag</p>';
132 ?>
133 </td>
134 </tr>
135
136 <tr>
137 <th scope="row">
138 <?php esc_html_e('Locale', 'catch-web-tools'); ?>
139 </th>
140 <td>
141 <?php
142 $text = (! empty($settings['og:locale'])) ? esc_attr($settings['og:locale']) : '';
143 echo '<input type="text" size="80" name="catchwebtools_opengraph[og:locale]" value="' . esc_attr($text) . '" /><p id="description">og:locale tag</p>';
144 ?>
145 </td>
146 </tr>
147
148 </tbody>
149 </table>
150 <?php submit_button('Save Changes'); ?>
151 </div>
152
153 <h3 class="option-toggle"><a href="#"><?php esc_html_e('Default Settings', 'catch-web-tools'); ?></a></h3>
154 <div class="option-content inside">
155 <table class="form-table">
156 <tbody>
157 <tr>
158 <th scope="row">
159 <?php esc_html_e('Default Image', 'catch-web-tools'); ?>
160 </th>
161 <td>
162 <?php
163 $text = (! empty($settings['og:default_image'])) ? esc_attr($settings['og:default_image']) : '';
164 echo '
165 <input type="url" class="upload-url" size="80" name="catchwebtools_opengraph[og:default_image]" value="' . esc_attr($text) . '" />
166 <input id="st_upload_button" class="st_upload_button button" name="catchwebtools_opengraph[og:default_image]" type="button" value="' . esc_attr__('Upload', 'catch-web-tools') . '" />';
167 echo '<p class="description">' . esc_html__('This image is used if the post/page being shared does not contain any images.', 'catch-web-tools') . '</p>';
168 ?>
169 </td>
170 </tr>
171 </tbody>
172 </table>
173 <?php submit_button('Save Changes'); ?>
174 </div>
175
176 <h3 class="option-toggle"><a href="#"><?php esc_html_e('Custom Settings (Only for Advanced Users)', 'catch-web-tools'); ?></a></h3>
177 <div class="option-content inside">
178 <table class="form-table">
179 <tbody>
180 <tr>
181 <th scope="row">
182 <?php esc_html_e('Custom Tags', 'catch-web-tools'); ?>
183 </th>
184 <td>
185 <?php
186 $text = (! empty($settings['custom'])) ? esc_attr($settings['custom']) : '';
187 echo '<textarea cols="80" rows="7" name="catchwebtools_opengraph[custom]" >' . esc_attr($text) . '</textarea>';
188 echo '<p class="description">' . esc_html__('For any other type of Open Graph tags.', 'catch-web-tools') . '</p>';
189 echo '<p class="description">' . esc_html__('E.g:', 'catch-web-tools') . '<code>&lt;meta property="og:audio" content="http://example.com/sound.mp3" /&gt;</code>';
190 echo '<p class="description">' . esc_html__('If you do not know what this is, you should probably leave it empty.', 'catch-web-tools');
191 ?>
192 </td>
193 </tr>
194 </tbody>
195 </table>
196 <?php submit_button('Save Changes'); ?>
197 </div>
198
199
200 </div>
201 </form>
202 </div><!-- .content -->
203 </div><!-- .content-wrapper -->
204 </div><!-- #customcss -->
205
206 <?php include('main-footer.php'); ?>