WordPress.org

Plugin Directory

sharedaddy

Opened 7 years ago

Last modified 7 years ago

#1325 new defect

Sharedaddy "Only show once" makes not showing icons

Reported by: p0l0 Owned by: johnny5
Priority: high Severity: critical
Plugin: sharedaddy Keywords:
Cc:

Description

If a plugin executes the "apply_filters" function, sharedaddy sets a mark that it was already rendered, and will not show up when wordpress renders the content.

I did a quick and dirty fix in sharing-service.php file, checking if the "div" is present in the content to check if it was already posted, and the buttons shows up again:

<?php
     // Only show once
     if ( isset( $shared_with_posts[$post->ID] ) ) {
         $found = strstr($text, '<div class="snap_nopreview sharing robots-nocontent">');
         $show = (empty($found))?true:false;
     }

Change History (1)

comment:1 @p0l07 years ago

Sorry, the code is incorrect, the correct one is this:

<?php
     // Only show once
     if ( isset( $shared_with_posts[$post->ID] ) && $show === true ) {
         $found = strstr($text, '<div class="snap_nopreview sharing robots-nocontent">');
         $show = (empty($found))?true:false;
     }
Note: See TracTickets for help on using tickets.