Version Description
Download this release
Release Info
| Developer | cbaldelomar |
| Plugin | |
| Version | 1.92 |
| Comparing to | |
| See all releases | |
Code changes from version 1.90 to 1.92
- README.md +8 -0
- includes/functions.php +10 -3
- readme.txt +8 -0
- wc-shortcodes.php +2 -2
README.md
CHANGED
|
@@ -66,6 +66,14 @@ Use the shortcode manager in the TinyMCE text editor
|
|
| 66 |
|
| 67 |
## Changelog ##
|
| 68 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 69 |
### Version 1.90
|
| 70 |
|
| 71 |
* added option for share buttons on woocommerce product page
|
| 66 |
|
| 67 |
## Changelog ##
|
| 68 |
|
| 69 |
+
### Version 1.92
|
| 70 |
+
|
| 71 |
+
* removed the_excerpt filter for share buttons
|
| 72 |
+
|
| 73 |
+
### Version 1.91
|
| 74 |
+
|
| 75 |
+
* Don't output Share flair on excerpts
|
| 76 |
+
|
| 77 |
### Version 1.90
|
| 78 |
|
| 79 |
* added option for share buttons on woocommerce product page
|
includes/functions.php
CHANGED
|
@@ -375,6 +375,8 @@ function wc_shortcodes_echo_share_buttons() {
|
|
| 375 |
}
|
| 376 |
}
|
| 377 |
function wc_shortcodes_display_share_buttons( $content ) {
|
|
|
|
|
|
|
| 378 |
$display = false;
|
| 379 |
|
| 380 |
if ( is_single() && 'post' == get_post_type() ) {
|
|
@@ -383,12 +385,17 @@ function wc_shortcodes_display_share_buttons( $content ) {
|
|
| 383 |
else if ( ( is_home() || is_archive() ) && 'post' == get_post_type() ) {
|
| 384 |
$display = true;
|
| 385 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 386 |
|
| 387 |
if ( ! $display ) {
|
| 388 |
return $content;
|
| 389 |
}
|
| 390 |
|
| 391 |
$share = do_shortcode( '[wc_share_buttons]' );
|
|
|
|
| 392 |
|
| 393 |
if ( empty( $share ) ) {
|
| 394 |
return $content;
|
|
@@ -396,7 +403,7 @@ function wc_shortcodes_display_share_buttons( $content ) {
|
|
| 396 |
|
| 397 |
$content .= $share;
|
| 398 |
|
| 399 |
-
return
|
| 400 |
}
|
| 401 |
function wc_shortcodes_share_buttons_filters() {
|
| 402 |
$share_buttons_on_post_page = get_option( WC_SHORTCODES_PREFIX . 'share_buttons_on_post_page' );
|
|
@@ -413,14 +420,14 @@ function wc_shortcodes_share_buttons_filters() {
|
|
| 413 |
if ( $share_buttons_on_blog_page ) {
|
| 414 |
if ( is_home() ) {
|
| 415 |
add_filter( 'the_content', 'wc_shortcodes_display_share_buttons', 38, 1 );
|
| 416 |
-
add_filter( 'the_excerpt', 'wc_shortcodes_display_share_buttons', 38, 1 );
|
| 417 |
}
|
| 418 |
}
|
| 419 |
|
| 420 |
if ( $share_buttons_on_archive_page ) {
|
| 421 |
if ( is_category() || is_tag() || is_author() || is_date() ) {
|
| 422 |
add_filter( 'the_content', 'wc_shortcodes_display_share_buttons', 38, 1 );
|
| 423 |
-
add_filter( 'the_excerpt', 'wc_shortcodes_display_share_buttons', 38, 1 );
|
| 424 |
}
|
| 425 |
}
|
| 426 |
|
| 375 |
}
|
| 376 |
}
|
| 377 |
function wc_shortcodes_display_share_buttons( $content ) {
|
| 378 |
+
global $wp_current_filter;
|
| 379 |
+
|
| 380 |
$display = false;
|
| 381 |
|
| 382 |
if ( is_single() && 'post' == get_post_type() ) {
|
| 385 |
else if ( ( is_home() || is_archive() ) && 'post' == get_post_type() ) {
|
| 386 |
$display = true;
|
| 387 |
}
|
| 388 |
+
// Don't output flair on excerpts
|
| 389 |
+
if ( in_array( 'get_the_excerpt', (array) $wp_current_filter ) ) {
|
| 390 |
+
$display = false;
|
| 391 |
+
}
|
| 392 |
|
| 393 |
if ( ! $display ) {
|
| 394 |
return $content;
|
| 395 |
}
|
| 396 |
|
| 397 |
$share = do_shortcode( '[wc_share_buttons]' );
|
| 398 |
+
$share = apply_filters( 'wc_shortcodes_display_share_buttons', $share );
|
| 399 |
|
| 400 |
if ( empty( $share ) ) {
|
| 401 |
return $content;
|
| 403 |
|
| 404 |
$content .= $share;
|
| 405 |
|
| 406 |
+
return $content;
|
| 407 |
}
|
| 408 |
function wc_shortcodes_share_buttons_filters() {
|
| 409 |
$share_buttons_on_post_page = get_option( WC_SHORTCODES_PREFIX . 'share_buttons_on_post_page' );
|
| 420 |
if ( $share_buttons_on_blog_page ) {
|
| 421 |
if ( is_home() ) {
|
| 422 |
add_filter( 'the_content', 'wc_shortcodes_display_share_buttons', 38, 1 );
|
| 423 |
+
// add_filter( 'the_excerpt', 'wc_shortcodes_display_share_buttons', 38, 1 );
|
| 424 |
}
|
| 425 |
}
|
| 426 |
|
| 427 |
if ( $share_buttons_on_archive_page ) {
|
| 428 |
if ( is_category() || is_tag() || is_author() || is_date() ) {
|
| 429 |
add_filter( 'the_content', 'wc_shortcodes_display_share_buttons', 38, 1 );
|
| 430 |
+
// add_filter( 'the_excerpt', 'wc_shortcodes_display_share_buttons', 38, 1 );
|
| 431 |
}
|
| 432 |
}
|
| 433 |
|
readme.txt
CHANGED
|
@@ -88,6 +88,14 @@ Use the shortcode manager in the TinyMCE text editor
|
|
| 88 |
|
| 89 |
== Changelog ==
|
| 90 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 91 |
= Version 1.90 =
|
| 92 |
|
| 93 |
* added option for share buttons on woocommerce product page
|
| 88 |
|
| 89 |
== Changelog ==
|
| 90 |
|
| 91 |
+
= Version 1.92 =
|
| 92 |
+
|
| 93 |
+
* removed the_excerpt filter for share buttons
|
| 94 |
+
|
| 95 |
+
= Version 1.91 =
|
| 96 |
+
|
| 97 |
+
* Don't output Share flair on excerpts
|
| 98 |
+
|
| 99 |
= Version 1.90 =
|
| 100 |
|
| 101 |
* added option for share buttons on woocommerce product page
|
wc-shortcodes.php
CHANGED
|
@@ -5,11 +5,11 @@ Plugin URI: http://webplantmedia.com/starter-themes/wordpresscanvas/features/sho
|
|
| 5 |
Description: A family of shortcodes to enhance site functionality.
|
| 6 |
Author: Chris Baldelomar
|
| 7 |
Author URI: http://webplantmedia.com/
|
| 8 |
-
Version: 1.
|
| 9 |
License: GPLv2 or later
|
| 10 |
*/
|
| 11 |
|
| 12 |
-
define( 'WC_SHORTCODES_VERSION', '1.
|
| 13 |
define( 'WC_SHORTCODES_PREFIX', 'wc_shortcodes_' );
|
| 14 |
define( '_WC_SHORTCODES_PREFIX', '_wc_shortcodes_' );
|
| 15 |
define( 'WC_SHORTCODES_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
|
| 5 |
Description: A family of shortcodes to enhance site functionality.
|
| 6 |
Author: Chris Baldelomar
|
| 7 |
Author URI: http://webplantmedia.com/
|
| 8 |
+
Version: 1.92
|
| 9 |
License: GPLv2 or later
|
| 10 |
*/
|
| 11 |
|
| 12 |
+
define( 'WC_SHORTCODES_VERSION', '1.92' );
|
| 13 |
define( 'WC_SHORTCODES_PREFIX', 'wc_shortcodes_' );
|
| 14 |
define( '_WC_SHORTCODES_PREFIX', '_wc_shortcodes_' );
|
| 15 |
define( 'WC_SHORTCODES_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
|
