Skip to:
Content
Pages
Categories
Search
Top
Bottom

Nested shortcode for ID in BBP shortcodes


  • UserCentrix
    Participant

    @usercentrix

    I am trying to integrate BBPress into a site created with Toolset – Layouts, Types and Views.

    The following BBPress shortcodes require an ID parameter:

    [bbp-single-forum id=$forum_id]
    [bbp-topic-form forum_id=$forum_id]
    [bbp-single-topic id=$topic_id]
    [bbp-single-reply id=$reply_id]

    Each of the IDs required above are aliases for the post_id, which Toolset privides a shortcode for. In order to get the templates to work for layouts applied to single Forums, Topics and Replies I need to include the current post ID. The simplest way I can imagine to do this would be as follows?

    [bbp-single-forum id='[wpv-post-id]’]
    [bbp-topic-form forum_id='[wpv-post-id]’]
    [bbp-single-topic id='[wpv-post-id]’]
    [bbp-single-reply id='[wpv-post-id]’]

    Unfortunately I get the following output at the front end?

    ‘]

    This makes clear to me that nested shortcodes are not supported in the BBPress. Is there a straightforward way of extending this functionality, perhaps through the functions.php file? This would create full compatibility with BBPress and Toolset. I couldn’t find any solutions to this shared on this support forum but it seems to me as something that may be a common problem and could have been tackled before.

    I hope you can assist.

Viewing 4 replies - 1 through 4 (of 4 total)

  • UserCentrix
    Participant

    @usercentrix

    No response in nearly 5 days is leaving me rather concerned to use bbPress. Is this the ussual support response-time?

    Anyway, I figured out a workaround using a plugin called PHP Code Widget.

    The plugin I am using is: https://wordpress.org/plugins/php-code-widget/

    An example of one of the codes I am using is:

    
    <?php
    $forum_id = get_the_ID();
    $forum_add_topic='[bbp-single-topic id ="'.$forum_id.'"]';
    echo do_shortcode($forum_add_topic);
    ?>
    

    Robin W
    Moderator

    @robin-w

    That’s sort of how Open Software works, product is free, support is free, but it does rely on volunteers like myself to take time away from earning money to do this.

    Anyway – thanks for posting your solution, it may help others coming across this in future.


    UserCentrix
    Participant

    @usercentrix

    Thanks Robin. I can’t argue with that and I appreciate the work of you and your colleagues. Incidentally, I would be happy to pay for support in the knowledge that I will then be able to offer better support to my clients.


    Robin W
    Moderator

    @robin-w

    you can always contact me via my website contact

    http://www.rewweb.co.uk

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