Version Description
- Added meta description and Schema.org name, description and image tags.
Download this release
Release Info
Developer | wonderm00n |
Plugin | Open Graph for Facebook, Google+ and Twitter Card Tags |
Version | 0.5 |
Comparing to | |
See all releases |
Code changes from version 0.4.3 to 0.5
- includes/settings-page.php +69 -17
- readme.txt +22 -3
- wonderm00n-open-graph.php +18 -5
includes/settings-page.php
CHANGED
@@ -21,16 +21,20 @@
|
|
21 |
update_option('wonderm00n_open_graph_fb_locale', trim($_POST['fb_locale']));
|
22 |
update_option('wonderm00n_open_graph_fb_sitename_show', intval($_POST['fb_sitename_show']));
|
23 |
update_option('wonderm00n_open_graph_fb_title_show', intval($_POST['fb_title_show']));
|
|
|
24 |
update_option('wonderm00n_open_graph_fb_url_show', intval($_POST['fb_url_show']));
|
25 |
update_option('wonderm00n_open_graph_fb_url_canonical', intval($_POST['fb_url_canonical']));
|
26 |
update_option('wonderm00n_open_graph_fb_url_add_trailing', intval($_POST['fb_url_add_trailing']));
|
27 |
update_option('wonderm00n_open_graph_fb_type_show', intval($_POST['fb_type_show']));
|
28 |
update_option('wonderm00n_open_graph_fb_type_homepage', trim($_POST['fb_type_homepage']));
|
29 |
update_option('wonderm00n_open_graph_fb_desc_show', intval($_POST['fb_desc_show']));
|
|
|
|
|
30 |
update_option('wonderm00n_open_graph_fb_desc_chars', intval($_POST['fb_desc_chars']));
|
31 |
update_option('wonderm00n_open_graph_fb_desc_homepage', trim($_POST['fb_desc_homepage']));
|
32 |
update_option('wonderm00n_open_graph_fb_desc_homepage_customtext', trim($_POST['fb_desc_homepage_customtext']));
|
33 |
update_option('wonderm00n_open_graph_fb_image_show', intval($_POST['fb_image_show']));
|
|
|
34 |
update_option('wonderm00n_open_graph_fb_image', trim($_POST['fb_image']));
|
35 |
update_option('wonderm00n_open_graph_fb_image_rss', intval($_POST['fb_image_rss']));
|
36 |
update_option('wonderm00n_open_graph_fb_image_use_featured', intval($_POST['fb_image_use_featured']));
|
@@ -91,8 +95,7 @@
|
|
91 |
</td>
|
92 |
</tr>
|
93 |
<tr>
|
94 |
-
<td
|
95 |
-
<td></td>
|
96 |
</tr>
|
97 |
<tr>
|
98 |
<th scope="row" nowrap="nowrap">Include Facebook Admin(s) ID (fb:admins) tag?</th>
|
@@ -109,8 +112,7 @@
|
|
109 |
</td>
|
110 |
</tr>
|
111 |
<tr>
|
112 |
-
<td
|
113 |
-
<td></td>
|
114 |
</tr>
|
115 |
<tr>
|
116 |
<th scope="row" nowrap="nowrap">Include locale (fb:locale) tag?</th>
|
@@ -161,8 +163,7 @@
|
|
161 |
</td>
|
162 |
</tr>
|
163 |
<tr>
|
164 |
-
<td
|
165 |
-
<td></td>
|
166 |
</tr>
|
167 |
<tr>
|
168 |
<th scope="row" nowrap="nowrap">Include Site Name (og:site_name) tag?</th>
|
@@ -171,18 +172,26 @@
|
|
171 |
</td>
|
172 |
</tr>
|
173 |
<tr>
|
174 |
-
<td
|
175 |
-
<td></td>
|
176 |
</tr>
|
177 |
<tr>
|
178 |
<th scope="row" nowrap="nowrap">Include Post/Page title (og:title) tag?</th>
|
179 |
<td>
|
180 |
-
<input type="checkbox" name="fb_title_show" id="fb_title_show" value="1" <?php echo (intval($fb_title_show)==1 ? ' checked="checked"' : '');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
181 |
</td>
|
182 |
</tr>
|
183 |
<tr>
|
184 |
-
<td
|
185 |
-
<td></td>
|
186 |
</tr>
|
187 |
<tr>
|
188 |
<th scope="row" nowrap="nowrap">Include URL (og:url) tag?</th>
|
@@ -194,6 +203,8 @@
|
|
194 |
<th scope="row" nowrap="nowrap">Also set Canonical URL:</th>
|
195 |
<td>
|
196 |
<input type="checkbox" name="fb_url_canonical" id="fb_url_canonical" value="1" <?php echo (intval($fb_url_canonical)==1 ? ' checked="checked"' : ''); ?>/>
|
|
|
|
|
197 |
</td>
|
198 |
</tr>
|
199 |
<tr class="fb_url_options">
|
@@ -205,8 +216,7 @@
|
|
205 |
</td>
|
206 |
</tr>
|
207 |
<tr>
|
208 |
-
<td
|
209 |
-
<td></td>
|
210 |
</tr>
|
211 |
<tr>
|
212 |
<th scope="row" nowrap="nowrap">Include Type (og:type) tag?</th>
|
@@ -227,8 +237,7 @@
|
|
227 |
</td>
|
228 |
</tr>
|
229 |
<tr>
|
230 |
-
<td
|
231 |
-
<td></td>
|
232 |
</tr>
|
233 |
<tr>
|
234 |
<th scope="row" nowrap="nowrap">Include Description (og:description) tag?</th>
|
@@ -236,6 +245,26 @@
|
|
236 |
<input type="checkbox" name="fb_desc_show" id="fb_desc_show" value="1" <?php echo (intval($fb_desc_show)==1 ? ' checked="checked"' : ''); ?> onclick="showDescriptionOptions();"/>
|
237 |
</td>
|
238 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
239 |
<tr class="fb_description_options">
|
240 |
<th scope="row" nowrap="nowrap">Description maximum length:</th>
|
241 |
<td>
|
@@ -258,8 +287,7 @@
|
|
258 |
</td>
|
259 |
</tr>
|
260 |
<tr>
|
261 |
-
<td
|
262 |
-
<td></td>
|
263 |
</tr>
|
264 |
<tr>
|
265 |
<th scope="row" nowrap="nowrap">Include Image (og:image) tag?</th>
|
@@ -267,6 +295,16 @@
|
|
267 |
<input type="checkbox" name="fb_image_show" id="fb_image_show" value="1" <?php echo (intval($fb_image_show)==1 ? ' checked="checked"' : ''); ?> onclick="showImageOptions();"/>
|
268 |
</td>
|
269 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
270 |
<tr class="fb_image_options">
|
271 |
<th scope="row" nowrap="nowrap">Default image:</th>
|
272 |
<td>
|
@@ -449,6 +487,7 @@
|
|
449 |
showUrlTrail();
|
450 |
jQuery('.fb_description_options').hide();
|
451 |
showDescriptionOptions();
|
|
|
452 |
jQuery('#fb_desc_homepage_customtext').hide();
|
453 |
showDescriptionCustomText();
|
454 |
showImageOptions();
|
@@ -502,6 +541,13 @@
|
|
502 |
jQuery('.fb_description_options').hide();
|
503 |
}
|
504 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
505 |
function showDescriptionCustomText() {
|
506 |
if (jQuery('#fb_desc_homepage').val()=='custom') {
|
507 |
jQuery('#fb_desc_homepage_customtext').show().focus();
|
@@ -521,4 +567,10 @@
|
|
521 |
TABLE.form-table TR TH {
|
522 |
font-weight: bold;
|
523 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
524 |
</style>
|
21 |
update_option('wonderm00n_open_graph_fb_locale', trim($_POST['fb_locale']));
|
22 |
update_option('wonderm00n_open_graph_fb_sitename_show', intval($_POST['fb_sitename_show']));
|
23 |
update_option('wonderm00n_open_graph_fb_title_show', intval($_POST['fb_title_show']));
|
24 |
+
update_option('wonderm00n_open_graph_fb_title_show_schema', intval($_POST['fb_title_show_schema']));
|
25 |
update_option('wonderm00n_open_graph_fb_url_show', intval($_POST['fb_url_show']));
|
26 |
update_option('wonderm00n_open_graph_fb_url_canonical', intval($_POST['fb_url_canonical']));
|
27 |
update_option('wonderm00n_open_graph_fb_url_add_trailing', intval($_POST['fb_url_add_trailing']));
|
28 |
update_option('wonderm00n_open_graph_fb_type_show', intval($_POST['fb_type_show']));
|
29 |
update_option('wonderm00n_open_graph_fb_type_homepage', trim($_POST['fb_type_homepage']));
|
30 |
update_option('wonderm00n_open_graph_fb_desc_show', intval($_POST['fb_desc_show']));
|
31 |
+
update_option('wonderm00n_open_graph_fb_desc_show_meta', intval($_POST['fb_desc_show_meta']));
|
32 |
+
update_option('wonderm00n_open_graph_fb_desc_show_schema', intval($_POST['fb_desc_show_schema']));
|
33 |
update_option('wonderm00n_open_graph_fb_desc_chars', intval($_POST['fb_desc_chars']));
|
34 |
update_option('wonderm00n_open_graph_fb_desc_homepage', trim($_POST['fb_desc_homepage']));
|
35 |
update_option('wonderm00n_open_graph_fb_desc_homepage_customtext', trim($_POST['fb_desc_homepage_customtext']));
|
36 |
update_option('wonderm00n_open_graph_fb_image_show', intval($_POST['fb_image_show']));
|
37 |
+
update_option('wonderm00n_open_graph_fb_image_show_schema', intval($_POST['fb_image_show_schema']));
|
38 |
update_option('wonderm00n_open_graph_fb_image', trim($_POST['fb_image']));
|
39 |
update_option('wonderm00n_open_graph_fb_image_rss', intval($_POST['fb_image_rss']));
|
40 |
update_option('wonderm00n_open_graph_fb_image_use_featured', intval($_POST['fb_image_use_featured']));
|
95 |
</td>
|
96 |
</tr>
|
97 |
<tr>
|
98 |
+
<td colspan="2"><hr/></td>
|
|
|
99 |
</tr>
|
100 |
<tr>
|
101 |
<th scope="row" nowrap="nowrap">Include Facebook Admin(s) ID (fb:admins) tag?</th>
|
112 |
</td>
|
113 |
</tr>
|
114 |
<tr>
|
115 |
+
<td colspan="2"><hr/></td>
|
|
|
116 |
</tr>
|
117 |
<tr>
|
118 |
<th scope="row" nowrap="nowrap">Include locale (fb:locale) tag?</th>
|
163 |
</td>
|
164 |
</tr>
|
165 |
<tr>
|
166 |
+
<td colspan="2"><hr/></td>
|
|
|
167 |
</tr>
|
168 |
<tr>
|
169 |
<th scope="row" nowrap="nowrap">Include Site Name (og:site_name) tag?</th>
|
172 |
</td>
|
173 |
</tr>
|
174 |
<tr>
|
175 |
+
<td colspan="2"><hr/></td>
|
|
|
176 |
</tr>
|
177 |
<tr>
|
178 |
<th scope="row" nowrap="nowrap">Include Post/Page title (og:title) tag?</th>
|
179 |
<td>
|
180 |
+
<input type="checkbox" name="fb_title_show" id="fb_title_show" value="1" <?php echo (intval($fb_title_show)==1 ? ' checked="checked"' : ''); ?> onclick="showTitleOptions();"/>
|
181 |
+
</td>
|
182 |
+
</tr>
|
183 |
+
<tr class="fb_title_options">
|
184 |
+
<th scope="row" nowrap="nowrap">Also include Schema.org "itemprop" Name tag?</th>
|
185 |
+
<td>
|
186 |
+
<input type="checkbox" name="fb_title_show_schema" id="fb_title_show_schema" value="1" <?php echo (intval($fb_title_show_schema)==1 ? ' checked="checked"' : ''); ?>/>
|
187 |
+
<br/>
|
188 |
+
<i><meta itemprop="name" content="..."/></i>
|
189 |
+
<br/>
|
190 |
+
Recommended for G+ sharing purposes if no other plugin is setting it already
|
191 |
</td>
|
192 |
</tr>
|
193 |
<tr>
|
194 |
+
<td colspan="2"><hr/></td>
|
|
|
195 |
</tr>
|
196 |
<tr>
|
197 |
<th scope="row" nowrap="nowrap">Include URL (og:url) tag?</th>
|
203 |
<th scope="row" nowrap="nowrap">Also set Canonical URL:</th>
|
204 |
<td>
|
205 |
<input type="checkbox" name="fb_url_canonical" id="fb_url_canonical" value="1" <?php echo (intval($fb_url_canonical)==1 ? ' checked="checked"' : ''); ?>/>
|
206 |
+
<br/>
|
207 |
+
<i><link rel="canonical" href="http://novo.opticapita.pt"/></i>
|
208 |
</td>
|
209 |
</tr>
|
210 |
<tr class="fb_url_options">
|
216 |
</td>
|
217 |
</tr>
|
218 |
<tr>
|
219 |
+
<td colspan="2"><hr/></td>
|
|
|
220 |
</tr>
|
221 |
<tr>
|
222 |
<th scope="row" nowrap="nowrap">Include Type (og:type) tag?</th>
|
237 |
</td>
|
238 |
</tr>
|
239 |
<tr>
|
240 |
+
<td colspan="2"><hr/></td>
|
|
|
241 |
</tr>
|
242 |
<tr>
|
243 |
<th scope="row" nowrap="nowrap">Include Description (og:description) tag?</th>
|
245 |
<input type="checkbox" name="fb_desc_show" id="fb_desc_show" value="1" <?php echo (intval($fb_desc_show)==1 ? ' checked="checked"' : ''); ?> onclick="showDescriptionOptions();"/>
|
246 |
</td>
|
247 |
</tr>
|
248 |
+
<tr class="fb_description_options">
|
249 |
+
<th scope="row" nowrap="nowrap">Also include Meta Description tag?</th>
|
250 |
+
<td>
|
251 |
+
<input type="checkbox" name="fb_desc_show_meta" id="fb_desc_show_meta" value="1" <?php echo (intval($fb_desc_show_meta)==1 ? ' checked="checked"' : ''); ?>/>
|
252 |
+
<br/>
|
253 |
+
<i><meta name="description" content="..."/></i>
|
254 |
+
<br/>
|
255 |
+
Recommended for SEO purposes if no other plugin is setting it already
|
256 |
+
</td>
|
257 |
+
</tr>
|
258 |
+
<tr class="fb_description_options">
|
259 |
+
<th scope="row" nowrap="nowrap">Also include Schema.org "itemprop" Description tag?</th>
|
260 |
+
<td>
|
261 |
+
<input type="checkbox" name="fb_desc_show_schema" id="fb_desc_show_schema" value="1" <?php echo (intval($fb_desc_show_schema)==1 ? ' checked="checked"' : ''); ?>/>
|
262 |
+
<br/>
|
263 |
+
<i><meta itemprop="description" content="..."/></i>
|
264 |
+
<br/>
|
265 |
+
Recommended for G+ sharing purposes if no other plugin is setting it already
|
266 |
+
</td>
|
267 |
+
</tr>
|
268 |
<tr class="fb_description_options">
|
269 |
<th scope="row" nowrap="nowrap">Description maximum length:</th>
|
270 |
<td>
|
287 |
</td>
|
288 |
</tr>
|
289 |
<tr>
|
290 |
+
<td colspan="2"><hr/></td>
|
|
|
291 |
</tr>
|
292 |
<tr>
|
293 |
<th scope="row" nowrap="nowrap">Include Image (og:image) tag?</th>
|
295 |
<input type="checkbox" name="fb_image_show" id="fb_image_show" value="1" <?php echo (intval($fb_image_show)==1 ? ' checked="checked"' : ''); ?> onclick="showImageOptions();"/>
|
296 |
</td>
|
297 |
</tr>
|
298 |
+
<tr class="fb_image_options">
|
299 |
+
<th scope="row" nowrap="nowrap">Also include Schema.org "itemprop" Image tag?</th>
|
300 |
+
<td>
|
301 |
+
<input type="checkbox" name="fb_image_show_schema" id="fb_image_show_schema" value="1" <?php echo (intval($fb_image_show_schema)==1 ? ' checked="checked"' : ''); ?>/>
|
302 |
+
<br/>
|
303 |
+
<i><meta itemprop="image" content="..."/></i>
|
304 |
+
<br/>
|
305 |
+
Recommended for G+ sharing purposes if no other plugin is setting it already
|
306 |
+
</td>
|
307 |
+
</tr>
|
308 |
<tr class="fb_image_options">
|
309 |
<th scope="row" nowrap="nowrap">Default image:</th>
|
310 |
<td>
|
487 |
showUrlTrail();
|
488 |
jQuery('.fb_description_options').hide();
|
489 |
showDescriptionOptions();
|
490 |
+
showTitleOptions();
|
491 |
jQuery('#fb_desc_homepage_customtext').hide();
|
492 |
showDescriptionCustomText();
|
493 |
showImageOptions();
|
541 |
jQuery('.fb_description_options').hide();
|
542 |
}
|
543 |
}
|
544 |
+
function showTitleOptions() {
|
545 |
+
if (jQuery('#fb_title_show').is(':checked')) {
|
546 |
+
jQuery('.fb_title_options').show();
|
547 |
+
} else {
|
548 |
+
jQuery('.fb_title_options').hide();
|
549 |
+
}
|
550 |
+
}
|
551 |
function showDescriptionCustomText() {
|
552 |
if (jQuery('#fb_desc_homepage').val()=='custom') {
|
553 |
jQuery('#fb_desc_homepage_customtext').show().focus();
|
567 |
TABLE.form-table TR TH {
|
568 |
font-weight: bold;
|
569 |
}
|
570 |
+
TABLE.form-table TR TD HR {
|
571 |
+
height: 1px;
|
572 |
+
margin: 0px;
|
573 |
+
background-color: #DFDFDF;
|
574 |
+
border: none;
|
575 |
+
}
|
576 |
</style>
|
readme.txt
CHANGED
@@ -4,18 +4,20 @@ Donate link: http://blog.wonderm00n.com/2011/10/14/wordpress-plugin-simple-faceb
|
|
4 |
Tags: facebook, open graph, seo, share, social, meta
|
5 |
Requires at least: 3
|
6 |
Tested up to: 3.5.1
|
7 |
-
Stable tag: 0.
|
8 |
|
9 |
This plugin inserts Facebook Open Graph Tags into your WordPress Blog/Website for more effective Facebook sharing results.
|
|
|
10 |
|
11 |
== Description ==
|
12 |
|
13 |
This plugin inserts Facebook Open Graph Tags into your WordPress Blog/Website for more effective Facebook sharing results.
|
14 |
-
It also allows to
|
|
|
15 |
|
16 |
It allows the user to choose which tags are, or not, included and also the default image if the post/page doesn't have one.
|
17 |
|
18 |
-
The
|
19 |
|
20 |
* **fb:app_id** : From settings on the options screen.
|
21 |
* **fb:admins** : From settings on the options screen.
|
@@ -27,6 +29,19 @@ The tags that this plugin inserts are:
|
|
27 |
* **og:description** : From post/page excerpt if it exist, or from post/page content. From category/tag description on it's pages, if it exist. From tagline, or custom text, on all the others.
|
28 |
* **og:image** : From post/page featured/thumbnail image, or if it doesn't exist from the first image in the post content, or if it doesn't exist from the first image on the post media gallery, or if it doesn't exist from the default image defined on the options menu. The same image chosen here will be used and enclosure/media:content on the RSS feed.
|
29 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
== Installation ==
|
31 |
|
32 |
1. Upload the `wonderm00n-open-graph` to the `/wp-content/plugins/` directory
|
@@ -35,6 +50,10 @@ The tags that this plugin inserts are:
|
|
35 |
|
36 |
== Changelog ==
|
37 |
|
|
|
|
|
|
|
|
|
38 |
= 0.4.3 =
|
39 |
|
40 |
* Fixed a bug where the original, Wordpress stock, Canonical URL was not being removed.
|
4 |
Tags: facebook, open graph, seo, share, social, meta
|
5 |
Requires at least: 3
|
6 |
Tested up to: 3.5.1
|
7 |
+
Stable tag: 0.5
|
8 |
|
9 |
This plugin inserts Facebook Open Graph Tags into your WordPress Blog/Website for more effective Facebook sharing results.
|
10 |
+
It also allows you to add the Meta Description tag and Schema.org Name, Description and Image tags for more effective Google+ sharing results.
|
11 |
|
12 |
== Description ==
|
13 |
|
14 |
This plugin inserts Facebook Open Graph Tags into your WordPress Blog/Website for more effective Facebook sharing results.
|
15 |
+
It also allows you to add the Meta Description tag and Schema.org Name, Description and Image tags for more effective Google+ sharing results.
|
16 |
+
You can also choose to insert the "enclosure" and "media:content" tags to the RSS feeds, so that apps like RSS Graffiti and twitterfeed post the image to Facebook correctly.
|
17 |
|
18 |
It allows the user to choose which tags are, or not, included and also the default image if the post/page doesn't have one.
|
19 |
|
20 |
+
The Facebook Open Graph Tags that this plugin inserts are:
|
21 |
|
22 |
* **fb:app_id** : From settings on the options screen.
|
23 |
* **fb:admins** : From settings on the options screen.
|
29 |
* **og:description** : From post/page excerpt if it exist, or from post/page content. From category/tag description on it's pages, if it exist. From tagline, or custom text, on all the others.
|
30 |
* **og:image** : From post/page featured/thumbnail image, or if it doesn't exist from the first image in the post content, or if it doesn't exist from the first image on the post media gallery, or if it doesn't exist from the default image defined on the options menu. The same image chosen here will be used and enclosure/media:content on the RSS feed.
|
31 |
|
32 |
+
The Schema.org Tags that this plugin inserts are:
|
33 |
+
|
34 |
+
* **name** : Same as "og:title"
|
35 |
+
* **description** : Same as "og:description"
|
36 |
+
* **image** : Same as "og:image"
|
37 |
+
|
38 |
+
Other Tags:
|
39 |
+
|
40 |
+
* **meta description** : Same as "og:description"
|
41 |
+
* **enclosure** : On RSS feeds, same as "og:image"
|
42 |
+
* **media:content** : On RSS feeds, same as "og:image"
|
43 |
+
|
44 |
+
|
45 |
== Installation ==
|
46 |
|
47 |
1. Upload the `wonderm00n-open-graph` to the `/wp-content/plugins/` directory
|
50 |
|
51 |
== Changelog ==
|
52 |
|
53 |
+
= 0.5 =
|
54 |
+
|
55 |
+
* Added meta description and Schema.org name, description and image tags.
|
56 |
+
|
57 |
= 0.4.3 =
|
58 |
|
59 |
* Fixed a bug where the original, Wordpress stock, Canonical URL was not being removed.
|
wonderm00n-open-graph.php
CHANGED
@@ -1,18 +1,18 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* @package Wonderm00n's Simple Facebook Open Graph Meta Tags
|
4 |
-
* @version 0.
|
5 |
*/
|
6 |
/*
|
7 |
Plugin Name: Wonderm00n's Simple Facebook Open Graph Meta Tags
|
8 |
Plugin URI: http://blog.wonderm00n.com/2011/10/14/wordpress-plugin-simple-facebook-open-graph-tags/
|
9 |
-
Description: This plugin inserts Facebook Open Graph Tags into your
|
10 |
Author: Marco Almeida (Wonderm00n)
|
11 |
-
Version: 0.
|
12 |
Author URI: http://wonderm00n.com
|
13 |
*/
|
14 |
|
15 |
-
$wonderm00n_open_graph_plugin_version='0.
|
16 |
$wonderm00n_open_graph_plugin_settings=array(
|
17 |
'fb_app_id_show',
|
18 |
'fb_app_id',
|
@@ -22,16 +22,20 @@ $wonderm00n_open_graph_plugin_settings=array(
|
|
22 |
'fb_locale',
|
23 |
'fb_sitename_show',
|
24 |
'fb_title_show',
|
|
|
25 |
'fb_url_show',
|
26 |
'fb_url_canonical',
|
27 |
'fb_url_add_trailing',
|
28 |
'fb_type_show',
|
29 |
'fb_type_homepage',
|
30 |
'fb_desc_show',
|
|
|
|
|
31 |
'fb_desc_chars',
|
32 |
'fb_desc_homepage',
|
33 |
'fb_desc_homepage_customtext',
|
34 |
'fb_image_show',
|
|
|
35 |
'fb_image',
|
36 |
'fb_image_rss',
|
37 |
'fb_image_use_featured',
|
@@ -249,7 +253,8 @@ function wonderm00n_open_graph() {
|
|
249 |
//If no description let's just add the title
|
250 |
if (trim($fb_desc)=='') $fb_desc=$fb_title;
|
251 |
|
252 |
-
$html='
|
|
|
253 |
';
|
254 |
if (intval($fb_app_id_show)==1 && trim($fb_app_id)!='') $html.='<meta property="fb:app_id" content="'.trim($fb_app_id).'" />
|
255 |
';
|
@@ -260,6 +265,8 @@ function wonderm00n_open_graph() {
|
|
260 |
if (intval($fb_sitename_show)==1) $html.='<meta property="og:site_name" content="'.get_bloginfo('name').'" />
|
261 |
';
|
262 |
if (intval($fb_title_show)==1) $html.='<meta property="og:title" content="'.trim($fb_title).'" />
|
|
|
|
|
263 |
';
|
264 |
if (intval($fb_url_show)==1) {
|
265 |
$html.='<meta property="og:url" content="'.trim(esc_attr($fb_url)).'" />
|
@@ -273,8 +280,14 @@ function wonderm00n_open_graph() {
|
|
273 |
if (intval($fb_type_show)==1) $html.='<meta property="og:type" content="'.trim(esc_attr($fb_type)).'" />
|
274 |
';
|
275 |
if (intval($fb_desc_show)==1) $html.='<meta property="og:description" content="'.trim($fb_desc).'" />
|
|
|
|
|
|
|
|
|
276 |
';
|
277 |
if(intval($fb_image_show)==1 && trim($fb_image)!='') $html.='<meta property="og:image" content="'.trim(esc_attr($fb_image)).'" />
|
|
|
|
|
278 |
';
|
279 |
$html.='<!-- END - Wonderm00n\'s Simple Facebook Open Graph Tags -->
|
280 |
';
|
1 |
<?php
|
2 |
/**
|
3 |
* @package Wonderm00n's Simple Facebook Open Graph Meta Tags
|
4 |
+
* @version 0.5
|
5 |
*/
|
6 |
/*
|
7 |
Plugin Name: Wonderm00n's Simple Facebook Open Graph Meta Tags
|
8 |
Plugin URI: http://blog.wonderm00n.com/2011/10/14/wordpress-plugin-simple-facebook-open-graph-tags/
|
9 |
+
Description: This plugin inserts Facebook Open Graph Tags into your WordPress Blog/Website for more effective Facebook sharing results. It also allows you to add the Meta Description tag and Schema.org Name, Description and Image tags for more effective Google+ sharing results. You can also choose to insert the "enclosure" and "media:content" tags to the RSS feeds, so that apps like RSS Graffiti and twitterfeed post the image to Facebook correctly.
|
10 |
Author: Marco Almeida (Wonderm00n)
|
11 |
+
Version: 0.5
|
12 |
Author URI: http://wonderm00n.com
|
13 |
*/
|
14 |
|
15 |
+
$wonderm00n_open_graph_plugin_version='0.5';
|
16 |
$wonderm00n_open_graph_plugin_settings=array(
|
17 |
'fb_app_id_show',
|
18 |
'fb_app_id',
|
22 |
'fb_locale',
|
23 |
'fb_sitename_show',
|
24 |
'fb_title_show',
|
25 |
+
'fb_title_show_schema',
|
26 |
'fb_url_show',
|
27 |
'fb_url_canonical',
|
28 |
'fb_url_add_trailing',
|
29 |
'fb_type_show',
|
30 |
'fb_type_homepage',
|
31 |
'fb_desc_show',
|
32 |
+
'fb_desc_show_meta',
|
33 |
+
'fb_desc_show_schema',
|
34 |
'fb_desc_chars',
|
35 |
'fb_desc_homepage',
|
36 |
'fb_desc_homepage_customtext',
|
37 |
'fb_image_show',
|
38 |
+
'fb_image_show_schema',
|
39 |
'fb_image',
|
40 |
'fb_image_rss',
|
41 |
'fb_image_use_featured',
|
253 |
//If no description let's just add the title
|
254 |
if (trim($fb_desc)=='') $fb_desc=$fb_title;
|
255 |
|
256 |
+
$html='
|
257 |
+
<!-- START - Wonderm00n\'s Simple Facebook Open Graph Tags '.$wonderm00n_open_graph_plugin_version.' -->
|
258 |
';
|
259 |
if (intval($fb_app_id_show)==1 && trim($fb_app_id)!='') $html.='<meta property="fb:app_id" content="'.trim($fb_app_id).'" />
|
260 |
';
|
265 |
if (intval($fb_sitename_show)==1) $html.='<meta property="og:site_name" content="'.get_bloginfo('name').'" />
|
266 |
';
|
267 |
if (intval($fb_title_show)==1) $html.='<meta property="og:title" content="'.trim($fb_title).'" />
|
268 |
+
';
|
269 |
+
if (intval($fb_title_show_schema)==1) $html.='<meta itemprop="name" content="'.trim($fb_title).'" />
|
270 |
';
|
271 |
if (intval($fb_url_show)==1) {
|
272 |
$html.='<meta property="og:url" content="'.trim(esc_attr($fb_url)).'" />
|
280 |
if (intval($fb_type_show)==1) $html.='<meta property="og:type" content="'.trim(esc_attr($fb_type)).'" />
|
281 |
';
|
282 |
if (intval($fb_desc_show)==1) $html.='<meta property="og:description" content="'.trim($fb_desc).'" />
|
283 |
+
';
|
284 |
+
if (intval($fb_desc_show_meta)==1) $html.='<meta name="description" content="'.trim($fb_desc).'" />
|
285 |
+
';
|
286 |
+
if (intval($fb_desc_show_schema)==1) $html.='<meta itemprop="description" content="'.trim($fb_desc).'" />
|
287 |
';
|
288 |
if(intval($fb_image_show)==1 && trim($fb_image)!='') $html.='<meta property="og:image" content="'.trim(esc_attr($fb_image)).'" />
|
289 |
+
';
|
290 |
+
if(intval($fb_image_show_schema)==1 && trim($fb_image)!='') $html.='<meta itemprop="image" content="'.trim(esc_attr($fb_image)).'" />
|
291 |
';
|
292 |
$html.='<!-- END - Wonderm00n\'s Simple Facebook Open Graph Tags -->
|
293 |
';
|