Version Description
Please update to version 2.0.7 for several critical fixes and enhancements to the Pinterest buttons.
Download this release
Release Info
Developer | MarijnRongen |
Plugin | Social Sharing Toolkit |
Version | 2.0.7 |
Comparing to | |
See all releases |
Code changes from version 2.0.6 to 2.0.7
- languages/mr_social_sharing_toolkit-nl_NL.mo +0 -0
- languages/mr_social_sharing_toolkit-nl_NL.po +7 -1
- languages/mr_social_sharing_toolkit.pot +6 -0
- readme.txt +15 -2
- screenshot-1.png +0 -0
- screenshot-2.png +0 -0
- screenshot-3.png +0 -0
- social_sharing_toolkit.php +127 -82
languages/mr_social_sharing_toolkit-nl_NL.mo
CHANGED
Binary file
|
languages/mr_social_sharing_toolkit-nl_NL.po
CHANGED
@@ -8,7 +8,7 @@ msgstr ""
|
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
11 |
-
"PO-Revision-Date: 2012-04-
|
12 |
"Last-Translator: Marijn Rongen <m.rongen@active-bits.nl>\n"
|
13 |
"Language-Team: Dutch <LL@li.org>\n"
|
14 |
|
@@ -186,6 +186,12 @@ msgstr "Open Graph inschakelen"
|
|
186 |
msgid "Default image URL"
|
187 |
msgstr "Standaard afbeelding URL"
|
188 |
|
|
|
|
|
|
|
|
|
|
|
|
|
189 |
msgid "You can specify a link to an image you would like to include in your likes and shares"
|
190 |
msgstr "U kunt een link naar een afbeelding invullen die u wilt gebruiken voor gedeelde inhoud"
|
191 |
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
11 |
+
"PO-Revision-Date: 2012-04-09 21:31+0100\n"
|
12 |
"Last-Translator: Marijn Rongen <m.rongen@active-bits.nl>\n"
|
13 |
"Language-Team: Dutch <LL@li.org>\n"
|
14 |
|
186 |
msgid "Default image URL"
|
187 |
msgstr "Standaard afbeelding URL"
|
188 |
|
189 |
+
msgid "You can specify a link to an image you would like to use for Pinterest pins when no image is available"
|
190 |
+
msgstr "U kunt een link naar een afbeelding invullen die u wilt gebruiken voor Pinterest pins indien geen afbeelding is gevonden"
|
191 |
+
|
192 |
+
msgid "Check this box to always display the default image with your Pins"
|
193 |
+
msgstr "Vink deze knop aan om altijd de standaard afbeelding to tonen bij uw Pins"
|
194 |
+
|
195 |
msgid "You can specify a link to an image you would like to include in your likes and shares"
|
196 |
msgstr "U kunt een link naar een afbeelding invullen die u wilt gebruiken voor gedeelde inhoud"
|
197 |
|
languages/mr_social_sharing_toolkit.pot
CHANGED
@@ -189,6 +189,12 @@ msgstr ""
|
|
189 |
msgid "Default image URL"
|
190 |
msgstr ""
|
191 |
|
|
|
|
|
|
|
|
|
|
|
|
|
192 |
msgid "You can specify a link to an image you would like to include in your likes and shares"
|
193 |
msgstr ""
|
194 |
|
189 |
msgid "Default image URL"
|
190 |
msgstr ""
|
191 |
|
192 |
+
msgid "You can specify a link to an image you would like to use for Pinterest pins when no image is available"
|
193 |
+
msgstr ""
|
194 |
+
|
195 |
+
msgid "Check this box to always display the default image with your Pins"
|
196 |
+
msgstr ""
|
197 |
+
|
198 |
msgid "You can specify a link to an image you would like to include in your likes and shares"
|
199 |
msgstr ""
|
200 |
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=P8ZVN
|
|
4 |
Tags: Facebook, Like, LinkedIn, Share, Google, Plus, +1, Pinterest, Google+, Twitter, Tweet, Buffer, Follow, StumbleUpon, Stumble, Tumblr, Delicious, Digg, Reddit, Myspace, Hyves, YouTube, Flickr, 500px, Picasa, deaviantART, mail, RSS, feed, connect, recommend, social, sharing, widget, shortcode, page, post, button, counter, icon, bitly, Open Graph
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 3.3.1
|
7 |
-
Stable tag: 2.0.
|
8 |
License: GPLv2 or later
|
9 |
|
10 |
Easy sharing and connecting on social networks. Display on posts or use widgets or shortcode. Also Twitter name/hashtag to link converter.
|
@@ -102,6 +102,11 @@ Twitter names will link to their Twitter profile and hashtags will link to the T
|
|
102 |
|
103 |
Since version 2.0.5 the plugin has the option to use bitly to shorten the urls for the tweet button. To use it you need to register with bitly and fill in your bitly username and API key.
|
104 |
|
|
|
|
|
|
|
|
|
|
|
105 |
= Open Graph =
|
106 |
|
107 |
Since version 2.0.5 the plugin also has the option to automatically create Open Graph tags on your Wordpress site. These will tell Facebook for example which image to display when sharing a page.
|
@@ -154,10 +159,14 @@ Upload the Social Sharing Toolkit plugin to the `/wp-content/plugins/` folder on
|
|
154 |
|
155 |
1. Plugin configuration: General settings
|
156 |
2. Plugin configuration: Content, Shortcode and Share Widget have the same options
|
157 |
-
3. Advanced settings with bitly and Open Graph
|
158 |
|
159 |
== Upgrade Notice ==
|
160 |
|
|
|
|
|
|
|
|
|
161 |
= 2.0.6 =
|
162 |
|
163 |
Please update to version 2.0.6 for several small bug fixes and enhancements.
|
@@ -203,6 +212,10 @@ Please update to version 1.0.1 to prevent an unexpected printing of the page tit
|
|
203 |
|
204 |
== Changelog ==
|
205 |
|
|
|
|
|
|
|
|
|
206 |
= 2.0.6 =
|
207 |
* Fixed buttons not appearing on pages
|
208 |
* Fixed Pinterest issue
|
4 |
Tags: Facebook, Like, LinkedIn, Share, Google, Plus, +1, Pinterest, Google+, Twitter, Tweet, Buffer, Follow, StumbleUpon, Stumble, Tumblr, Delicious, Digg, Reddit, Myspace, Hyves, YouTube, Flickr, 500px, Picasa, deaviantART, mail, RSS, feed, connect, recommend, social, sharing, widget, shortcode, page, post, button, counter, icon, bitly, Open Graph
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 3.3.1
|
7 |
+
Stable tag: 2.0.7
|
8 |
License: GPLv2 or later
|
9 |
|
10 |
Easy sharing and connecting on social networks. Display on posts or use widgets or shortcode. Also Twitter name/hashtag to link converter.
|
102 |
|
103 |
Since version 2.0.5 the plugin has the option to use bitly to shorten the urls for the tweet button. To use it you need to register with bitly and fill in your bitly username and API key.
|
104 |
|
105 |
+
= Pinterest =
|
106 |
+
|
107 |
+
Since version 2.0.5 the plugin has the option to show Pinterest buttons. The plugin tries to find the featured image or first image in the content if available. If no image is available the button is omitted.
|
108 |
+
Since version 2.0.7 is is possible to enter the URL of a default image to use in case no image was found. You can also set the plugin to always use the default image regardless of any available images.
|
109 |
+
|
110 |
= Open Graph =
|
111 |
|
112 |
Since version 2.0.5 the plugin also has the option to automatically create Open Graph tags on your Wordpress site. These will tell Facebook for example which image to display when sharing a page.
|
159 |
|
160 |
1. Plugin configuration: General settings
|
161 |
2. Plugin configuration: Content, Shortcode and Share Widget have the same options
|
162 |
+
3. Advanced settings with bitly, Pinterest and Open Graph options
|
163 |
|
164 |
== Upgrade Notice ==
|
165 |
|
166 |
+
= 2.0.7 =
|
167 |
+
|
168 |
+
Please update to version 2.0.7 for several critical fixes and enhancements to the Pinterest buttons.
|
169 |
+
|
170 |
= 2.0.6 =
|
171 |
|
172 |
Please update to version 2.0.6 for several small bug fixes and enhancements.
|
212 |
|
213 |
== Changelog ==
|
214 |
|
215 |
+
= 2.0.7 =
|
216 |
+
* Included an option to specify a default image for the Pinterest button
|
217 |
+
* Fixed some major issues with shortcodes and excerpts
|
218 |
+
|
219 |
= 2.0.6 =
|
220 |
* Fixed buttons not appearing on pages
|
221 |
* Fixed Pinterest issue
|
screenshot-1.png
CHANGED
Binary file
|
screenshot-2.png
CHANGED
Binary file
|
screenshot-3.png
CHANGED
Binary file
|
social_sharing_toolkit.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Social Sharing Toolkit
|
4 |
Plugin URI: http://www.active-bits.nl/support/social-sharing-toolkit/
|
5 |
Description: This plugin enables sharing of your content via popular social networks and can also convert Twitter names and hashtags to links. Easy & configurable.
|
6 |
-
Version: 2.0.
|
7 |
Author: Marijn Rongen
|
8 |
Author URI: http://www.active-bits.nl
|
9 |
*/
|
@@ -89,9 +89,10 @@ class MR_Social_Sharing_Toolkit {
|
|
89 |
$followers[$key] = array('enable' => 0, 'type' => $val['types'][0], 'id' => '');
|
90 |
$follow_order[] = $key;
|
91 |
}
|
|
|
92 |
$bitly_options = array('enable' => 0, 'username' => '', 'key' => '');
|
93 |
$opengraph_options = array('enable' => 0, 'default_image' => '', 'fixed_image' => 0);
|
94 |
-
$this->options = array('mr_social_sharing_buttons' => $buttons, 'mr_social_sharing_shortcode_buttons' => $shortcodes, 'mr_social_sharing_widget_buttons' => $widgets, 'mr_social_sharing_follow_buttons' => $followers, 'mr_social_sharing_display' => 'span', 'mr_social_sharing_shortcode_display' => 'span', 'mr_social_sharing_widget_display' => 'span', 'mr_social_sharing_follow_display' => 'span', 'mr_social_sharing_align' => '', 'mr_social_sharing_shortcode_align' => '', 'mr_social_sharing_widget_align' => '', 'mr_social_sharing_follow_align' => '', 'mr_social_sharing_position' => 'none', 'mr_social_sharing_types' => array('post', 'page'), 'mr_social_sharing_enable_shortcode' => 1, 'mr_social_sharing_include_excerpts' => 1, 'mr_social_sharing_button_order' => $button_order, 'mr_social_sharing_shortcode_button_order' => $shortcode_order, 'mr_social_sharing_widget_button_order' => $widget_order, 'mr_social_sharing_follow_button_order' => $follow_order, 'mr_social_sharing_linkify_content' => 0, 'mr_social_sharing_linkify_comments' => 0, 'mr_social_sharing_linkify_new' => 1, 'mr_social_sharing_twitter_handles' => 0, 'mr_social_sharing_twitter_hashtags' => 0, 'mr_social_sharing_js_footer' => 1, 'mr_social_sharing_no_follow' => 0, 'mr_social_sharing_bitly' => $bitly_options, 'mr_social_sharing_opengraph' => $opengraph_options);
|
95 |
foreach ($this->options as $key => $val) {
|
96 |
$this->options[$key] = get_option( $key, $val );
|
97 |
}
|
@@ -322,6 +323,14 @@ class MR_Social_Sharing_Toolkit {
|
|
322 |
<input type="text" name="mr_social_sharing_bitly[username]" id="mr_social_sharing_bitly_username" value="'.$this->options['mr_social_sharing_bitly']['username'].'"/></br/>
|
323 |
<label for="mr_social_sharing_bitly_key">'.__('Your bitly API Key','mr_social_sharing_toolkit').'</label>
|
324 |
<input type="text" name="mr_social_sharing_bitly[key]" id="mr_social_sharing_bitly_key" value="'.$this->options['mr_social_sharing_bitly']['key'].'"/>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
325 |
<h4>'.__('OpenGraph','mr_social_sharing_toolkit').'</h4>
|
326 |
<p>'.__('Include Open Graph tags','mr_social_sharing_toolkit').'</p>
|
327 |
<label for="mr_social_sharing_opengraph_enable" class="check"><input type="checkbox" name="mr_social_sharing_opengraph[enable]" id="mr_social_sharing_opengraph_enable"';
|
@@ -333,7 +342,7 @@ class MR_Social_Sharing_Toolkit {
|
|
333 |
<label for="mr_social_sharing_opengraph_fixed_image" class="check"><input type="checkbox" name="mr_social_sharing_opengraph[fixed_image]" id="mr_social_sharing_opengraph_fixed_image"';
|
334 |
if ($this->options['mr_social_sharing_opengraph']['fixed_image'] == 1) { echo ' checked="checked"';}
|
335 |
echo ' value="1" /> '.__("Always use the default image", 'mr_social_sharing_toolkit').'</label><br/>
|
336 |
-
<p><span class="description">'.__("Check this box to always display the default image
|
337 |
</div>
|
338 |
</div>
|
339 |
<p class="submit">
|
@@ -468,7 +477,7 @@ class MR_Social_Sharing_Toolkit {
|
|
468 |
/* Output functions */
|
469 |
|
470 |
function print_opengraph() {
|
471 |
-
echo '<!-- Open Graph tags provided by Social Sharing Toolkit v2.0.
|
472 |
<meta property="og:locale" content="'.str_replace('-', '_', get_bloginfo('language')).'"/>';
|
473 |
if (is_single() || is_page()) {
|
474 |
$excerpt = get_the_excerpt();
|
@@ -739,8 +748,8 @@ class MR_Social_Sharing_Toolkit {
|
|
739 |
$url = 'http://'.$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
|
740 |
}
|
741 |
$bookmarks = '
|
742 |
-
|
743 |
-
|
744 |
foreach ($this->options['mr_social_sharing_'.$type.'button_order'] as $button) {
|
745 |
if ($this->options['mr_social_sharing_'.$type.'buttons'][$button]['enable'] == 1) {
|
746 |
$id = array_key_exists('id', $this->options['mr_social_sharing_'.$type.'buttons'][$button]) ? $this->options['mr_social_sharing_'.$type.'buttons'][$button]['id'] : '';
|
@@ -755,8 +764,8 @@ class MR_Social_Sharing_Toolkit {
|
|
755 |
|
756 |
function create_followers() {
|
757 |
$followers = '
|
758 |
-
|
759 |
-
|
760 |
foreach ($this->options['mr_social_sharing_follow_button_order'] as $button) {
|
761 |
if ($this->options['mr_social_sharing_follow_buttons'][$button]['enable'] == 1) {
|
762 |
$id = array_key_exists('id', $this->options['mr_social_sharing_follow_buttons'][$button]) ? $this->options['mr_social_sharing_follow_buttons'][$button]['id'] : '';
|
@@ -1372,33 +1381,40 @@ class MR_Social_Sharing_Toolkit {
|
|
1372 |
|
1373 |
function share($content) {
|
1374 |
$media = '';
|
1375 |
-
if (
|
1376 |
-
|
1377 |
-
|
1378 |
-
|
1379 |
-
|
1380 |
-
|
1381 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1382 |
}
|
1383 |
-
}
|
1384 |
-
if ($media == '') {
|
1385 |
-
$output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $content, $matches);
|
1386 |
-
$img = $matches[1][0];
|
1387 |
-
if($img != '') {
|
1388 |
-
$media = $img;
|
1389 |
-
}
|
1390 |
}
|
1391 |
$type = get_post_type();
|
1392 |
-
if (in_array($type, $this->options['mr_social_sharing_types']) && (is_single() || $type == 'page')) {
|
1393 |
if ($this->options['mr_social_sharing_position'] == 'top') {
|
1394 |
$bookmarks = $this->create_bookmarks(get_permalink(), the_title('','',false), '', $media);
|
1395 |
$content = $bookmarks.$content;
|
1396 |
}
|
1397 |
-
if ($this->options['mr_social_sharing_position'] == 'bottom'
|
1398 |
$bookmarks = $this->create_bookmarks(get_permalink(), the_title('','',false), '', $media);
|
1399 |
$content .= $bookmarks;
|
1400 |
}
|
1401 |
-
if ($this->options['mr_social_sharing_position'] == 'both'
|
1402 |
$bookmarks = $this->create_bookmarks(get_permalink(), the_title('','',false), '', $media);
|
1403 |
$content = $bookmarks.$content.$bookmarks;
|
1404 |
}
|
@@ -1408,21 +1424,28 @@ class MR_Social_Sharing_Toolkit {
|
|
1408 |
|
1409 |
function share_more_link($link) {
|
1410 |
$media = '';
|
1411 |
-
if (
|
1412 |
-
|
1413 |
-
|
1414 |
-
|
1415 |
-
|
1416 |
-
|
1417 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1418 |
}
|
1419 |
-
}
|
1420 |
-
if ($media == '') {
|
1421 |
-
$output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', get_the_content(), $matches);
|
1422 |
-
$img = $matches[1][0];
|
1423 |
-
if($img != '') {
|
1424 |
-
$media = $img;
|
1425 |
-
}
|
1426 |
}
|
1427 |
$type = get_post_type();
|
1428 |
if (in_array($type, $this->options['mr_social_sharing_types'])) {
|
@@ -1436,21 +1459,28 @@ class MR_Social_Sharing_Toolkit {
|
|
1436 |
|
1437 |
function share_excerpt($content) {
|
1438 |
$media = '';
|
1439 |
-
if (
|
1440 |
-
|
1441 |
-
|
1442 |
-
|
1443 |
-
|
1444 |
-
|
1445 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1446 |
}
|
1447 |
-
}
|
1448 |
-
if ($media == '') {
|
1449 |
-
$output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $content, $matches);
|
1450 |
-
$img = $matches[1][0];
|
1451 |
-
if($img != '') {
|
1452 |
-
$media = $img;
|
1453 |
-
}
|
1454 |
}
|
1455 |
$type = get_post_type();
|
1456 |
if (in_array($type, $this->options['mr_social_sharing_types'])) {
|
@@ -1479,24 +1509,32 @@ class MR_Social_Sharing_Toolkit {
|
|
1479 |
|
1480 |
function share_shortcode() {
|
1481 |
$media = '';
|
1482 |
-
if (
|
1483 |
-
|
1484 |
-
|
1485 |
-
|
1486 |
-
|
1487 |
-
|
1488 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1489 |
}
|
1490 |
-
}
|
1491 |
-
if ($media == '') {
|
1492 |
-
$output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', the_content(), $matches);
|
1493 |
-
$img = $matches[1][0];
|
1494 |
-
if($img != '') {
|
1495 |
-
$media = $img;
|
1496 |
-
}
|
1497 |
}
|
|
|
1498 |
$bookmarks = '';
|
1499 |
-
if ($this->options['mr_social_sharing_enable_shortcode'] == 1 && (is_single() || $this->options['mr_social_sharing_include_excerpts'] == 1)) {
|
1500 |
$bookmarks = $this->create_bookmarks(get_permalink(), the_title('','',false), 'shortcode_', $media);
|
1501 |
}
|
1502 |
return $bookmarks;
|
@@ -1549,21 +1587,28 @@ class MR_Social_Sharing_Toolkit_Widget extends WP_Widget {
|
|
1549 |
$url = empty($instance['fixed_url']) ? '' : $instance['fixed_url'];
|
1550 |
$title = empty($instance['fixed_title']) ? wp_title('', false) : $instance['fixed_title'];
|
1551 |
$media = '';
|
1552 |
-
if (
|
1553 |
-
|
1554 |
-
|
1555 |
-
|
1556 |
-
|
1557 |
-
|
1558 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1559 |
}
|
1560 |
-
}
|
1561 |
-
if ($media == '') {
|
1562 |
-
$output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', get_the_content(), $matches);
|
1563 |
-
$img = $matches[1][0];
|
1564 |
-
if($img != '') {
|
1565 |
-
$media = $img;
|
1566 |
-
}
|
1567 |
}
|
1568 |
$bookmarks = $MR_Social_Sharing_Toolkit->create_bookmarks($url, $title, 'widget_', $media);
|
1569 |
echo $before_widget;
|
3 |
Plugin Name: Social Sharing Toolkit
|
4 |
Plugin URI: http://www.active-bits.nl/support/social-sharing-toolkit/
|
5 |
Description: This plugin enables sharing of your content via popular social networks and can also convert Twitter names and hashtags to links. Easy & configurable.
|
6 |
+
Version: 2.0.7
|
7 |
Author: Marijn Rongen
|
8 |
Author URI: http://www.active-bits.nl
|
9 |
*/
|
89 |
$followers[$key] = array('enable' => 0, 'type' => $val['types'][0], 'id' => '');
|
90 |
$follow_order[] = $key;
|
91 |
}
|
92 |
+
$pinterest_options = array('default_image' => '', 'fixed_image' => 0);
|
93 |
$bitly_options = array('enable' => 0, 'username' => '', 'key' => '');
|
94 |
$opengraph_options = array('enable' => 0, 'default_image' => '', 'fixed_image' => 0);
|
95 |
+
$this->options = array('mr_social_sharing_buttons' => $buttons, 'mr_social_sharing_shortcode_buttons' => $shortcodes, 'mr_social_sharing_widget_buttons' => $widgets, 'mr_social_sharing_follow_buttons' => $followers, 'mr_social_sharing_display' => 'span', 'mr_social_sharing_shortcode_display' => 'span', 'mr_social_sharing_widget_display' => 'span', 'mr_social_sharing_follow_display' => 'span', 'mr_social_sharing_align' => '', 'mr_social_sharing_shortcode_align' => '', 'mr_social_sharing_widget_align' => '', 'mr_social_sharing_follow_align' => '', 'mr_social_sharing_position' => 'none', 'mr_social_sharing_types' => array('post', 'page'), 'mr_social_sharing_enable_shortcode' => 1, 'mr_social_sharing_include_excerpts' => 1, 'mr_social_sharing_button_order' => $button_order, 'mr_social_sharing_shortcode_button_order' => $shortcode_order, 'mr_social_sharing_widget_button_order' => $widget_order, 'mr_social_sharing_follow_button_order' => $follow_order, 'mr_social_sharing_linkify_content' => 0, 'mr_social_sharing_linkify_comments' => 0, 'mr_social_sharing_linkify_new' => 1, 'mr_social_sharing_twitter_handles' => 0, 'mr_social_sharing_twitter_hashtags' => 0, 'mr_social_sharing_js_footer' => 1, 'mr_social_sharing_no_follow' => 0, 'mr_social_sharing_pinterest' => $pinterest_options, 'mr_social_sharing_bitly' => $bitly_options, 'mr_social_sharing_opengraph' => $opengraph_options);
|
96 |
foreach ($this->options as $key => $val) {
|
97 |
$this->options[$key] = get_option( $key, $val );
|
98 |
}
|
323 |
<input type="text" name="mr_social_sharing_bitly[username]" id="mr_social_sharing_bitly_username" value="'.$this->options['mr_social_sharing_bitly']['username'].'"/></br/>
|
324 |
<label for="mr_social_sharing_bitly_key">'.__('Your bitly API Key','mr_social_sharing_toolkit').'</label>
|
325 |
<input type="text" name="mr_social_sharing_bitly[key]" id="mr_social_sharing_bitly_key" value="'.$this->options['mr_social_sharing_bitly']['key'].'"/>
|
326 |
+
<h4>'.__('Pinterest','mr_social_sharing_toolkit').'</h4>
|
327 |
+
<label for="mr_social_sharing_pinterest_default_image">'.__('Default image URL','mr_social_sharing_toolkit').'</label>
|
328 |
+
<input type="text" name="mr_social_sharing_pinterest[default_image]" id="mr_social_sharing_pinterest_default_image" value="'.$this->options['mr_social_sharing_pinterest']['default_image'].'"/></br/>
|
329 |
+
<p><span class="description">'.__('You can specify a link to an image you would like to use for Pinterest pins when no image is available','mr_social_sharing_toolkit').'</span></p>
|
330 |
+
<label for="mr_social_sharing_pinterest_fixed_image" class="check"><input type="checkbox" name="mr_social_sharing_pinterest[fixed_image]" id="mr_social_sharing_pinterest_fixed_image"';
|
331 |
+
if ($this->options['mr_social_sharing_pinterest']['fixed_image'] == 1) { echo ' checked="checked"';}
|
332 |
+
echo ' value="1" /> '.__("Always use the default image", 'mr_social_sharing_toolkit').'</label><br/>
|
333 |
+
<p><span class="description">'.__("Check this box to always display the default image with your Pins", 'mr_social_sharing_toolkit').'</span></p>
|
334 |
<h4>'.__('OpenGraph','mr_social_sharing_toolkit').'</h4>
|
335 |
<p>'.__('Include Open Graph tags','mr_social_sharing_toolkit').'</p>
|
336 |
<label for="mr_social_sharing_opengraph_enable" class="check"><input type="checkbox" name="mr_social_sharing_opengraph[enable]" id="mr_social_sharing_opengraph_enable"';
|
342 |
<label for="mr_social_sharing_opengraph_fixed_image" class="check"><input type="checkbox" name="mr_social_sharing_opengraph[fixed_image]" id="mr_social_sharing_opengraph_fixed_image"';
|
343 |
if ($this->options['mr_social_sharing_opengraph']['fixed_image'] == 1) { echo ' checked="checked"';}
|
344 |
echo ' value="1" /> '.__("Always use the default image", 'mr_social_sharing_toolkit').'</label><br/>
|
345 |
+
<p><span class="description">'.__("Check this box to always display the default image with your shared content", 'mr_social_sharing_toolkit').'</span></p>
|
346 |
</div>
|
347 |
</div>
|
348 |
<p class="submit">
|
477 |
/* Output functions */
|
478 |
|
479 |
function print_opengraph() {
|
480 |
+
echo '<!-- Open Graph tags provided by Social Sharing Toolkit v2.0.7 -->
|
481 |
<meta property="og:locale" content="'.str_replace('-', '_', get_bloginfo('language')).'"/>';
|
482 |
if (is_single() || is_page()) {
|
483 |
$excerpt = get_the_excerpt();
|
748 |
$url = 'http://'.$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
|
749 |
}
|
750 |
$bookmarks = '
|
751 |
+
<div class="mr_social_sharing_wrapper">
|
752 |
+
<!-- Social Sharing Toolkit v2.0.7 | http://www.active-bits.nl/support/social-sharing-toolkit/ -->';
|
753 |
foreach ($this->options['mr_social_sharing_'.$type.'button_order'] as $button) {
|
754 |
if ($this->options['mr_social_sharing_'.$type.'buttons'][$button]['enable'] == 1) {
|
755 |
$id = array_key_exists('id', $this->options['mr_social_sharing_'.$type.'buttons'][$button]) ? $this->options['mr_social_sharing_'.$type.'buttons'][$button]['id'] : '';
|
764 |
|
765 |
function create_followers() {
|
766 |
$followers = '
|
767 |
+
<div class="mr_social_sharing_wrapper">
|
768 |
+
<!-- Social Sharing Toolkit v2.0.7 | http://www.active-bits.nl/support/social-sharing-toolkit/ -->';
|
769 |
foreach ($this->options['mr_social_sharing_follow_button_order'] as $button) {
|
770 |
if ($this->options['mr_social_sharing_follow_buttons'][$button]['enable'] == 1) {
|
771 |
$id = array_key_exists('id', $this->options['mr_social_sharing_follow_buttons'][$button]) ? $this->options['mr_social_sharing_follow_buttons'][$button]['id'] : '';
|
1381 |
|
1382 |
function share($content) {
|
1383 |
$media = '';
|
1384 |
+
if ($this->options['mr_social_sharing_pinterest']['default_image'] != '' && $this->options['mr_social_sharing_pinterest']['fixed_image'] == 1) {
|
1385 |
+
$media = $this->options['mr_social_sharing_pinterest']['default_image'];
|
1386 |
+
} else {
|
1387 |
+
if (current_theme_supports('post-thumbnails')) {
|
1388 |
+
if ($media = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()))) {
|
1389 |
+
if (is_array($media)) {
|
1390 |
+
$media = $media[0];
|
1391 |
+
} else {
|
1392 |
+
$media = '';
|
1393 |
+
}
|
1394 |
+
}
|
1395 |
+
}
|
1396 |
+
if ($media == '') {
|
1397 |
+
$output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $content, $matches);
|
1398 |
+
$img = $matches[1][0];
|
1399 |
+
if($img != '') {
|
1400 |
+
$media = $img;
|
1401 |
+
}
|
1402 |
+
}
|
1403 |
+
if ($media == '' && $this->options['mr_social_sharing_pinterest']['default_image'] != '') {
|
1404 |
+
$media = $this->options['mr_social_sharing_pinterest']['default_image'];
|
1405 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1406 |
}
|
1407 |
$type = get_post_type();
|
1408 |
+
if (in_array($type, $this->options['mr_social_sharing_types']) && ((is_single() || $this->options['mr_social_sharing_include_excerpts'] == 1) || $type == 'page')) {
|
1409 |
if ($this->options['mr_social_sharing_position'] == 'top') {
|
1410 |
$bookmarks = $this->create_bookmarks(get_permalink(), the_title('','',false), '', $media);
|
1411 |
$content = $bookmarks.$content;
|
1412 |
}
|
1413 |
+
if ($this->options['mr_social_sharing_position'] == 'bottom') {
|
1414 |
$bookmarks = $this->create_bookmarks(get_permalink(), the_title('','',false), '', $media);
|
1415 |
$content .= $bookmarks;
|
1416 |
}
|
1417 |
+
if ($this->options['mr_social_sharing_position'] == 'both') {
|
1418 |
$bookmarks = $this->create_bookmarks(get_permalink(), the_title('','',false), '', $media);
|
1419 |
$content = $bookmarks.$content.$bookmarks;
|
1420 |
}
|
1424 |
|
1425 |
function share_more_link($link) {
|
1426 |
$media = '';
|
1427 |
+
if ($this->options['mr_social_sharing_pinterest']['default_image'] != '' && $this->options['mr_social_sharing_pinterest']['fixed_image'] == 1) {
|
1428 |
+
$media = $this->options['mr_social_sharing_pinterest']['default_image'];
|
1429 |
+
} else {
|
1430 |
+
if (current_theme_supports('post-thumbnails')) {
|
1431 |
+
if ($media = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()))) {
|
1432 |
+
if (is_array($media)) {
|
1433 |
+
$media = $media[0];
|
1434 |
+
} else {
|
1435 |
+
$media = '';
|
1436 |
+
}
|
1437 |
+
}
|
1438 |
+
}
|
1439 |
+
if ($media == '') {
|
1440 |
+
$output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', get_the_content(), $matches);
|
1441 |
+
$img = $matches[1][0];
|
1442 |
+
if($img != '') {
|
1443 |
+
$media = $img;
|
1444 |
+
}
|
1445 |
+
}
|
1446 |
+
if ($media == '' && $this->options['mr_social_sharing_pinterest']['default_image'] != '') {
|
1447 |
+
$media = $this->options['mr_social_sharing_pinterest']['default_image'];
|
1448 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1449 |
}
|
1450 |
$type = get_post_type();
|
1451 |
if (in_array($type, $this->options['mr_social_sharing_types'])) {
|
1459 |
|
1460 |
function share_excerpt($content) {
|
1461 |
$media = '';
|
1462 |
+
if ($this->options['mr_social_sharing_pinterest']['default_image'] != '' && $this->options['mr_social_sharing_pinterest']['fixed_image'] == 1) {
|
1463 |
+
$media = $this->options['mr_social_sharing_pinterest']['default_image'];
|
1464 |
+
} else {
|
1465 |
+
if (current_theme_supports('post-thumbnails')) {
|
1466 |
+
if ($media = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()))) {
|
1467 |
+
if (is_array($media)) {
|
1468 |
+
$media = $media[0];
|
1469 |
+
} else {
|
1470 |
+
$media = '';
|
1471 |
+
}
|
1472 |
+
}
|
1473 |
+
}
|
1474 |
+
if ($media == '') {
|
1475 |
+
$output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $content, $matches);
|
1476 |
+
$img = $matches[1][0];
|
1477 |
+
if($img != '') {
|
1478 |
+
$media = $img;
|
1479 |
+
}
|
1480 |
+
}
|
1481 |
+
if ($media == '' && $this->options['mr_social_sharing_pinterest']['default_image'] != '') {
|
1482 |
+
$media = $this->options['mr_social_sharing_pinterest']['default_image'];
|
1483 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1484 |
}
|
1485 |
$type = get_post_type();
|
1486 |
if (in_array($type, $this->options['mr_social_sharing_types'])) {
|
1509 |
|
1510 |
function share_shortcode() {
|
1511 |
$media = '';
|
1512 |
+
if ($this->options['mr_social_sharing_pinterest']['default_image'] != '' && $this->options['mr_social_sharing_pinterest']['fixed_image'] == 1) {
|
1513 |
+
$media = $this->options['mr_social_sharing_pinterest']['default_image'];
|
1514 |
+
} else {
|
1515 |
+
if (current_theme_supports('post-thumbnails')) {
|
1516 |
+
if ($media = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()))) {
|
1517 |
+
if (is_array($media)) {
|
1518 |
+
$media = $media[0];
|
1519 |
+
} else {
|
1520 |
+
$media = '';
|
1521 |
+
}
|
1522 |
+
}
|
1523 |
+
}
|
1524 |
+
if ($media == '') {
|
1525 |
+
$output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', get_the_content(), $matches);
|
1526 |
+
$img = $matches[1][0];
|
1527 |
+
if($img != '') {
|
1528 |
+
$media = $img;
|
1529 |
+
}
|
1530 |
+
}
|
1531 |
+
if ($media == '' && $this->options['mr_social_sharing_pinterest']['default_image'] != '') {
|
1532 |
+
$media = $this->options['mr_social_sharing_pinterest']['default_image'];
|
1533 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1534 |
}
|
1535 |
+
$type = get_post_type();
|
1536 |
$bookmarks = '';
|
1537 |
+
if ($this->options['mr_social_sharing_enable_shortcode'] == 1 && ((is_single() || $type == 'page') || $this->options['mr_social_sharing_include_excerpts'] == 1)) {
|
1538 |
$bookmarks = $this->create_bookmarks(get_permalink(), the_title('','',false), 'shortcode_', $media);
|
1539 |
}
|
1540 |
return $bookmarks;
|
1587 |
$url = empty($instance['fixed_url']) ? '' : $instance['fixed_url'];
|
1588 |
$title = empty($instance['fixed_title']) ? wp_title('', false) : $instance['fixed_title'];
|
1589 |
$media = '';
|
1590 |
+
if ($this->options['mr_social_sharing_pinterest']['default_image'] != '' && $this->options['mr_social_sharing_pinterest']['fixed_image'] == 1) {
|
1591 |
+
$media = $this->options['mr_social_sharing_pinterest']['default_image'];
|
1592 |
+
} else {
|
1593 |
+
if (current_theme_supports('post-thumbnails')) {
|
1594 |
+
if ($media = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()))) {
|
1595 |
+
if (is_array($media)) {
|
1596 |
+
$media = $media[0];
|
1597 |
+
} else {
|
1598 |
+
$media = '';
|
1599 |
+
}
|
1600 |
+
}
|
1601 |
+
}
|
1602 |
+
if ($media == '') {
|
1603 |
+
$output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', get_the_content(), $matches);
|
1604 |
+
$img = $matches[1][0];
|
1605 |
+
if($img != '') {
|
1606 |
+
$media = $img;
|
1607 |
+
}
|
1608 |
+
}
|
1609 |
+
if ($media == '' && $this->options['mr_social_sharing_pinterest']['default_image'] != '') {
|
1610 |
+
$media = $this->options['mr_social_sharing_pinterest']['default_image'];
|
1611 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1612 |
}
|
1613 |
$bookmarks = $MR_Social_Sharing_Toolkit->create_bookmarks($url, $title, 'widget_', $media);
|
1614 |
echo $before_widget;
|