can you give us the code for your custom block please
I actually don’t have much written as it wasn’t doing squat at the time! Lol. And it’s not a true Gutenberg block, it’s just an ACF block that pulls in some PHP. Really what I tried most was using
<?php if ( bbp_get_user_forum_subscriptions() ) : ?>
<?php bbp_get_template_part( 'loop', 'forums' ); ?>
<?php else : ?>
<?php bbp_get_template_part( 'feedback', 'no-forums' ); ?>
<?php endif; ?>
However, when displaying that content within any standard page and passing the current user ID into bbp_get_user_forum_subscriptions()
, it only outputs a single forum subscription.
ok, so can you outline what you wish to achieve?
Like I said in the opening of my post, I’m looking to display the user’s subscribed to topics and forums on the homepage of the site. Here’s the actual design I’m going for – https://i.imgur.com/zoAhh5G.png. I pretty much just want to emulate what’s happening on the profile level forums page within my custom ACF block.
thanks, sorry I don’t always get enough brain time to go back through a topic.
hmmm…code would take a while to work out, beyond free help from me, sorry.
I’m not necessarily looking for someone to write out the code for me. I’m just looking for some general direction on how to get it done. Any links to other resources would be super valuable.
🙂 The problem is that I’d have to work out how to do it first !! so lots of code searching.
So a bit like you wanting some hints on how to solve a crossword clue – until I’ve solved it, I can’t help you and then I might as well give you the answer 🙂
I’d suspect it is to do with resetting globals
best offer I can have is download the bbp_style_pack plugin, and navigate to /includes/shortcodes.php
the bsp-display-topic-index does topics within a page, and line 34 is a link to the query which filters these to the settings.
so if you copied that function and all it’s sub functions, renamed them all to prevent conflict, and then if you used the guts of bbp_get_user_topic_subscriptions to replace the query, that might get you close.
Once done for topics, then you could re-write for forums.
Best I can do