Hi,
After updating WooCommerce to the latest version (4.6.1), the plugin is now hiding the WordPress admin bar for bbPress moderators and keymasters. Making it harder for them to moderate the forums.
The following code in my functions.php file used to resolve the issue, however it no longer works:
add_action('init', function(){
if(class_exists('WooCommerce') && function_exists('bbp_get_user_role') && is_user_logged_in()){
$current_user = wp_get_current_user();
$user_id = $current_user->ID;
$bbp_get_user_role = bbp_get_user_role($user_id);
if($bbp_get_user_role == 'bbp_keymaster' || $bbp_get_user_role == 'bbp_moderator'){
add_filter( 'woocommerce_prevent_admin_access', '__return_false' );
add_filter( 'woocommerce_disable_admin_bar', '__return_false' );
}
}
});
I posted this question to the WooCommerce forums and am also posting it here in case anyone else is having similar problems?
Any help or ideas greatly appreciated.
Thank you,
Sam
WordPress 5.5.1
bbPress 2.6.5
WooCommerce 4.6.1
Hi,
Looking for the same thing, but to show subscribed forums…
Can your code be changed for that?
Hello,
I want to create a widget for the sidebar of my site that shows the current user’s subscribed forums. (Like when you go to the user profile, you can see a list of subscribed forums, I want to have that list in a sidebar widget.)
Is there a shortcode that could do this? Like:
[bbp-forum-index id=$subscribed]
I see that bbp_get_user_rewrite_id()
exists, but there’s no filter in it. Is it possible to override that and have it use display name?
Hi, currently the user slug for my site is:
https://domain.com/forums/users/first-last/ (it may not be exactly first-last, but it’s not what i ultimately want it to be).
I want that to be: https://domain.com/forums/users/{display-name}/
and it to change if the user changes their display name (301s aside, let’s not worry about old links to their profile that may exist)
Is this possible out of the box? or via some method (code, plugin, etc)
try adding this to your theme’s custom css, or the custom css tab of style pack
.mce-ico {
background: transparent center center !important;
color: #595959 !important;
}
you might need to play with the color to get what you want
Thanks Robin, I check that a bbpress.php was created with this code:
<?php
get_header();
?>
<div class="td-main-content-wrap td-main-page-wrap td-container-wrap">
<div class="td-container">
<div class="td-pb-row">
<div class="td-pb-span8 td-main-content">
<div class="td-ss-main-content">
<?php
if (have_posts()) {
while ( have_posts() ) : the_post();
?>
<h1 class="entry-title td-page-title">
<a href="<?php the_permalink()?>" rel="bookmark" title="<?php the_title_attribute() ?>"><?php the_title() ?></a>
</h1>
<?php
the_content();
endwhile; //end loop
}
?>
</div>
</div>
<div class="td-pb-span4 td-main-sidebar">
<div class="td-ss-main-sidebar">
<?php dynamic_sidebar( 'td-default' ) ?>
</div>
</div>
</div> <!-- /.td-pb-row -->
</div> <!-- /.td-container -->
</div>
<?php
get_footer();
?>
And I change with for this code:
<?php
get_header();
?>
<div class="td-main-content-wrap td-main-page-wrap td-container-wrap">
<div class="td-container">
<div class="td-pb-row">
<div class="td-pb-span8 td-main-content">
<div class="td-ss-main-content">
<?php
if (have_posts()) {
while ( have_posts() ) : the_post();
?>
<h1 class="entry-title td-page-title">
<a href="<?php the_permalink()?>" rel="bookmark" title="<?php the_title_attribute() ?>"><?php the_title() ?></a>
</h1>
<?php
the_content();
endwhile; //end loop
}
?>
</div>
</div>
</div> <!-- /.td-pb-row -->
</div> <!-- /.td-container -->
</div>
<?php
get_footer();
?>
I refresh cache but nothing happends. Any idea?
bbpress just uses wordpress signup, so whatever your WordPress site is using.
There are several plugins that will let you change this email eg
https://www.wpbeginner.com/plugins/how-to-send-a-custom-welcome-email-to-new-users-in-wordpress/
or if you’re into coding, just google around to find some code
- WordPress 5.4.2
- bbpress 2.6.5
- Buddypress 6.3.0 w/ Activities module activated
- bbp Style pack w/ both form editors (TinyMCE + text) activated
- bbp Mentions suggest
The bbp Mentions suggest plugin by the venerable @robin-w still works and enables autocomplete mentions in TinyMCE as well as in the Text (HTML) tab of the editor … but only on initial page load, since bbpress 2.6.2.
Since bbpress 2.6.2, when clicking on Reply to a specific comment on a subject thread, the dynamic reply form now appears under the comment in question, and the window scrolls to it. Which is a very nice improvement! However, this breaks Robin’s plugin for the TinyMCE editor (mentions do still autocomplete in the Text editor, at least).
I’m not a developer but I’m guessing it has to do with the new version of /bbpress/templates/default/js/reply.js, specifically the addEditor
function at the end of the file.
@robin-w any ideas how to get your plugin to play nice with the dynamic reply form in bbpress ≥2.6.2?
Or anyone else out there?
Cheers in advance!
Just need help with this… If I have to go into the CSS to make it work, please give me SPECIFIC instructions as I do’t code. Thank you.
first, i try this will not work but then i read again and put this code again its works fine thanks.
sorry, one of the many annoying thing now that WordPress has blocks is that it doesn’t like shortcodes unless written in a special way – I’ll release a new version shortly, but yes you add it as a shortcode block in a page, and that is your forums page
Hi @robin-w, just jumping on this thread as it is the same topic.
I installed your bbpress style back a few days ago and it is up on my website. However, I can’t seem to figure out where to put the shortcodes to make them work. Do I need to put them in the files themselves or can I put them on in the page content? When I have tried to use the shortcode to force login on the forum index page for non-members (by putting it in the page content section), I get an error message that the “response received is not a valid JSON file.”
Many thanks for all your hard work on this!
subscriptions used to be stored with the user, so in usermeta wp__bbp_forum_subscriptions which is what you are seeing – that data here is old.
However on 2.6.x this has changed, and now subscriptions are stored in the postmeta of the forum or topic they are subscribed to.
Each user has an entry
so the query
SELECT * FROM
wp_postmetaWHERE
post_id= 2927 AND
meta_keyLIKE '_bbp_subscription' ORDER BY
meta_idASC
where 2927 is the ID of the forum
will produce
post_id meta_key meta_value
2927 _bbp_subscription 1
2927 _bbp_subscription 1191
where the subsbribers to forum 2927 are user_id’s 1 and 1191
Hi there,
I want to import 150 users to my forum and subscribe them to a new “test” forum topic in order to check if the email notification is working (it stops after sending 100 emails).
In order to do this, I use the plugin “import and export users and customers” to import a list of made-up users (username and email are all that is needed for columns in CSV file).
Then I create a new “test” forum.
Now I want to subscribe them all to this forum topic programmatically via MySQL.
The issue is, I have looked at the SQL table and the only data that I can find on user subscriptions is the wp_usermeta where meta_key = 'wp__bbp_forum_subscriptions'
. The meta_value
shows the ID of the forum that users are subscribed to.
The issue is that it seems to be no longer working. Is it a meta_value that BBpress no longer uses? If so, which one is used?
If I take a random subscribed user (ID=17248) and check what they are subscribed to, the following query works: select * from wp_usermeta where meta_key = 'wp__bbp_forum_subscriptions' and user_id = 17248;
. I can then see a list in the meta_value
table of what they are subscribed to. But if I then (using the BBp Toolkit plugin) alter their subscriptions and e.g. unsubscribe them from a topic, go back to the DB and do the same query, it shows the same forum subscription IDs, even though there should be one less.
Could you point me in the right direction of which table to query to alter the forum topic ids of a user please?
no code that works is clumsy !!
Hey guys,
I installed Bbpress on one of my multisites and i have used a plugin to allow users to register tto resgister rather than allowing registrations at the network level.
I have used the bbpress shortcodes for the registration page and the login page however when i test registering as a new user it redirects me to a local-signup page which i assume is happening due to it being a multisite? Is there any way to have only one form that meeds to be filled in? Do i need a user and registration plugin?
The main issue i have is that qhen i do complete the registration process thw new user reveives no email…
I then added a plugin for Smtp, configured it and it works in itself but not diffrrence to the bbpress registration process.
Not sure how to fix the issue, i also tried allowing users to register at a network level but made no difference?
Do i need to add somethinking like the Ultimate user registrations plugin or wp forms? Will that make a difference?
Im ising using latest version of wp and bbpress on my site…
I finally got it to work clumsily
<?php global $current_user; get_currentuserinfo(); $uid = bbp_get_current_user_id(); ?>
<?php if ( bbp_get_user_forum_subscriptions( $uid ) ) : ?>
<?php while ( bbp_forums() ) : bbp_the_forum(); ?>
<?php $subs[] = bbp_get_forum_id(); ?>
<?php endwhile; ?>
<?php $forumid = implode(', ', $subs); ?>
<?php echo do_shortcode('[bbp-display-topic-index template ="short" forum="' . $forumid . '"]'); ?>
<?php endif; ?>
@robin-w I visited your website and noticed all the amazing work you’ve done, thank you.
What I’ve been trying to do all along was to get your shortcode [bbp-display-topic-index show='5' forum ='10,11,12']
to php so that the forums could be the IDs of the forums the user is subscribed to.. so an array
I’ve been trying to get it to work to no avail, [bbp-display-topic-index show='5' forum ='$forum_id']
or the likes return nill or with all the topics from all the forums, not just the subscribed ones
ate you still running the threaded replies plugin I did a few days ago? that’s designed to work with threaded replies turned on, no idea what it does if you turn threaded replies off and leave it active.
Both it and the code above hook to the same link.
Hi Robin,
Sorry to re-open this.
the latest topics pagination works great! thanks to the code above,
BUT when I turned off threaded replies. the normal pagination in topics is strange..
here is what I mean
https://opentuition.com/forums/
the page numbers it shows are : 1, 2, 4
instead of 1, 2, 3, 4, or 1,2, 4
and when I go to some topic
and click on page 3
it shows like this:
1, 1, 2, 3
here is the example
https://opentuition.com/topic/obu-period-40-results-post-your-comments-instant-poll/page/3/
is there anything that can be done? do you think?
thanks
Kris
Correction, I am getting the bbp_forum_title() that we passed but not <?php bbp_get_template_part( 'loop', 'single-topic' ); ?>
that I was initially trying to filter.. No worries tho, one step closer
@robin-w thank you for all the help, after a bit of tinkering I changed bbp_get_user_forum_subscriptions
to bbp_get_user_topic_subscriptions
and it worked flawlessly, thank you so much
It’s still returning null, no output whatsoever. I even print_r($subs)
inside the while loop and nothing shows up, I’m using the latest versions of bbpress and wordpress, the theme is a blank starter theme with only bbpress plugin activated