Skip to:
Content
Pages
Categories
Search
Top
Bottom

Shortcodes do not run in Topics

  • @winrarz

    Participant

    Hello,

    We have a problem on our site with loading shortcodes on /topic/ pages, as you can see in the link below:
    http://www.futsverige.se/forums/topic/test/

    However, the shortcodes work everywhere else. So the problem seems to be within bbPress suppressing the do_shortcode() calls from the theme.

    Anyone knows what could cause this or point us in the right direction on how to circumvent it?

    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • @winrarz

    Participant

    It seems to me that this is the problematic code:

    in content-single-topic.php

    		<?php if ( bbp_has_replies() ) : ?>
    			<?php bbp_get_template_part( 'pagination', 'replies' ); ?>
    			<?php bbp_get_template_part( 'loop',       'replies' ); ?>
    			<?php bbp_get_template_part( 'pagination', 'replies' ); ?>
    		<?php endif; ?>

    If I remove this code block, all of the shortcodes start working.

    UPDATE 1:
    More specifically, this is the exact row that the problem appears at:
    <?php bbp_get_template_part( 'loop', 'replies' ); ?>

    UPDATE 2:
    I followed the problem down to..
    in file loop-single-reply.php
    <?php bbp_reply_content(); ?>

    If I remove this line, the shortcodes starts magically working.

    @winrarz

    Participant

    UPDATE 3:
    return apply_filters( 'bbp_get_reply_content', $content, $reply_id );
    in bbpress/includes/replies/template.php

    This code breaks the entire shortcode loading function.

    If I patch this to say return $content; it will start working.
    Now to see why this happened..

    @winrarz

    Participant

    SOLUTION!

    REMOVED:
    add_filter( 'bbp_get_reply_content', array( $this, "shortcode_whitelist" ) );
    FROM PLUGIN:
    bbPress Advanced Statistics, file: class-bbpress-advanced-statistics-extras.php
    CAUSE:
    Breaks the loading of shortcodes.

    I’m hopeful this will help someone else. It seemed to be a problem with the bbPress Advanced Statistics plugin.

    @geekserve

    Participant

    Hi,

    This is not an issue, it is a feature of the plugin you downloaded, installed and then enabled. That specific part of the plugin (the whitelist) is disabled by default, so you have enabled it yourself.

    Please read the text that is provided alongside the options in the plugin.

    The solution to this without editing the file is to simply disable the whitelist, or add the shortcodes that aren’t being displayed into the whitelist. You can do that within the ‘Extras’ tab.

    – The Plugin author.

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
Skip to toolbar