WordPress.org

Ready to get started?Download WordPress

Forums

Custom Post Widget
[resolved] Conflict with 2-click-socialmedia-button plugin (4 posts)

  1. DirkDatzert
    Member
    Posted 2 years ago #

    Hello Johann,

    I'm runing wordpress 3.3.1 with custom-post-widget 1.9.1 and 2-click-socialmedia-button 0.31.1

    On every article the 2-click-socialmedia-button is executed 6-7 times if custom-post-widget is active.

    On the german Support page of 2-click-socialmedia-button http://blog.ppfeufer.de/wordpress-plugin-2-click-social-media-buttons/comment-page-7/#comment-28184
    I found a hint that the apply_filters( 'the_content', $content ) should not called in themes or widgets since this is done via wordpress itself.

    I'm not aware of the internals of wordpress widgets programming, but if I remove the apply_fitler('the_content'...) from lines 64 in post-widget.php the conflict is removed and 2-click-socialmedia-buttton appears only once on a page.

    Maybe this is a bug.

    Regards,
    Dirk

    diff -uNr wordpress.orig/wp-content/plugins/custom-post-widget/post-widget.php wordpress/wp-content/plugins/custom-post-widget/post-widget.php
    --- wordpress.orig/wp-content/plugins/custom-post-widget/post-widget.php 2012-02-24 10:20:02.000000000 +0100
    +++ wordpress/wp-content/plugins/custom-post-widget/post-widget.php 2012-03-29 10:25:23.000000000 +0200
    @@ -64,7 +64,7 @@
    $show_custom_post_title = isset( $instance['show_custom_post_title'] ) ? $instance['show_custom_post_title'] : false;^M
    $content_post = get_post($custom_post_id);^M
    $content = $content_post->post_content;^M
    - $content = apply_filters('the_content', $content);^M
    + /** $content = apply_filters('the_content', $content); */^M
    echo $before_widget;^M
    if ( $show_custom_post_title ) {^M
    echo $before_title . apply_filters('widget_title',$content_post->post_title) . $after_title; // This is the line that displays the title (only if show title is set) ^M
    @@ -191,4 +191,4 @@
    if(in_array(CUSTOM_POST_WIDGET_CURRENT_PAGE, array('post.php', 'page.php', 'page-new.php', 'post-new.php'))) {^M
    add_action('admin_footer', 'add_content_block_popup');^M
    }^M
    -?>
    \ No newline at end of file
    +?>^M

    http://wordpress.org/extend/plugins/custom-post-widget/

  2. cassiedong
    Member
    Posted 2 years ago #

    Thank you DirkDatzert!

    I've had this issue for a while and always thought it was a problem with the other plugin - WP Customer Reviews 2.4.3 (http://wordpress.org/extend/plugins/wp-customer-reviews/) until I found this article.

    So glad it's all good now! Thanks again!

  3. Johan van der Wijk
    Member
    Plugin Author

    Posted 2 years ago #

    I have created a new version of the plugin which adds the option to disable the content filters via a checkbox on the widget. Could you please check if this solves your issue:

    http://downloads.wordpress.org/plugin/custom-post-widget.1.9.4.zip

  4. geoff67
    Member
    Posted 2 years ago #

    Johan,
    Your 1.9.4 update also fixed an issue with BuddyPress/bbPress where random content was being injected into each widget.

    Thank you very much for the patch. Extremely timely.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic