samtime (@samtime)

Forum Replies Created

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

  • samtime
    Participant

    @samtime

    Okay, got the following solution from a friend and it seems to work!
    Posting the updated code here incase others have the same problem:

    add_filter('woocommerce_disable_admin_bar', '_wc_disable_admin_bar', 10, 1);
     
    function _wc_disable_admin_bar($prevent_admin_access) {
        if (!current_user_can("keymaster") && !current_user_can("bbp_moderator") ) {
            return $prevent_admin_access;
        }
        return false;
    }

    samtime
    Participant

    @samtime

    Hi Robin, thank you for the code.
    I replaced my existing code with what you pasted here, unfortunately it didn’t fix the issue.
    Tried replacing the “WooCommerce” part with “woocommerce”, but still no luck.

    Thanks for the reply. If you have any other ideas, it would be greatly appreciated.
    I’ll keep searching.

    Thanks again,
    Sam

    Here’s the website btw:
    https://funkytime.tv/forums/


    samtime
    Participant

    @samtime

    Is there any code in buddypress > notifications that we can copy over to bbpress > includes > extend > buddypress > notifications.php (or vice versa), to make bbPress notifications automatically dismiss like Private Message, Friend Request, and other BuddyPress notifications do?

    If it’s not that straight forward, then is there a way to disable this style off bbPress notifications being sent to BuddyPress?

    My users (and I) really love the notification feature, but just find it really time-consuming to have to dismiss these notifications manually.

    Appreciate any help / advice,
    Sam


    samtime
    Participant

    @samtime

    Okay, thanks. I think I might have thought it was a bit more scary than it really is.
    As long as those attributes listed above only affect the design of the post, and not allow any sort of strange code to run.

    Here’s one of the posts from the user, looks like it’s just some funky formatting. Not too bad.

    html post

    Oh, and the skills tab he’s talking about in the post is to do with the Youzer plugin for BuddyPress. I think it just allows him to put more text there than neccessary, but not weird code.

    Skills bug


    samtime
    Participant

    @samtime

    Okay, found a solution (albeit a little janky):

    1. Go to the Topic and Reply screens in question (or any screen you want to edit), select “Screen Options” in the top right, then check/uncheck the meta-boxes that you want visible/invisible to your moderators (basically set up the screen to look the way you want moderators to see it)

    2. Install the plugIn FV Clone Screen Options

    3. Since FV doesn’t clone Screen Options to subscriber accounts (my moderators have the Subscriber WP role and Moderator bbPress role), temporarily give moderators the Contributor WordPress role.

    4. Now clone the Screen Options you set up in step one to your Moderators with the FV Clone Screen Options plugin

    5. Switch moderators back to the Subscriber WordPress Role

    6. Hide the “Screen Options” tab for Subscriber accounts using the Adminimize plugin (found under the plugin’s Global Options > Screen Options), so moderators can’t make those meta-boxes visible again

    Bit of a workaround, but seems to have worked.
    Only issue is that I will have to remember do this process for any new moderator that gets appointed.

    All the best, stay FUNKY!


    samtime
    Participant

    @samtime

    Okay, turned out the WooCommerce plugin was hiding the WordPress toolbar/dashboard in this situation.

    Fixed this by pasting the code below into my child theme’s functions.php file.
    Now the dashboard is available for bbPress moderators, but is still hidden for normal non-moderators, awesome!

    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' );
    }
    }
    });

    samtime
    Participant

    @samtime

    Hi Robin, the WordPress top toolbar doesn’t seem to appear for users with Moderator forum role and Subscriber WordPress role. And trying to go to a dashboard link (like …/wp-admin/edit.php?post_type=reply), redirects that user to their account page.
    Giving them “Contributor” or “Editor” role makes the toolbar show up.

    Hmmm…
    Let me know if you have any ideas (if you have time, super appreciated).

    Here’s the website if it helps: https://funkytime.tv/forums/


    samtime
    Participant

    @samtime

    SOLVED: I was able to fix this issue by changing the following setting…

    In the WordPress dashboard, go to Settings > Forums
    Under “Moderation Options” change moderation from “None” to “Custom”
    Then select the “All posts below the English character threshold” option.

    Now new users can still post replies/topics without having to be manual approved. But posts from users with a moderation flag will be held for review.

    Hope that helps and works for you!
    Best, Sam


    samtime
    Participant

    @samtime

    I’m having the same issue. Adding moderation flag doesn’t seem to hold that user’s posts for moderation. Any ideas?


    samtime
    Participant

    @samtime

    Robin, you’re magic! That did the trick, thanks so much 🙂

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