Skip to:
Content
Pages
Categories
Search
Top
Bottom

Cannot set forum moderator

  • @huetaylt

    Participant

    Hi
    When I edit a forum. Set Forum Moderators properity and Click Update button, but bbPress didn’t update forum moderators and didnot show any error. I checked for sure that username (which chosen to set for forum moderators) exist in wordpress user manager. I don’t know why. Pls help me

Viewing 6 replies - 1 through 6 (of 6 total)
  • @robin-w

    Moderator

    Did you try this more than once?

    @huetaylt

    Participant

    I tried with only one UserNname in Forum Moderators property, and tried many times with other UserName and result is the same.

    @stonebkfly

    Participant

    Did you ever figure out how to resolve this. I have the same issue.

    @robin-w

    Moderator

    the backend seems to only save one moderator.

    This code should fix

    add_action ('bbp_subscriptions_metabox' , 'rew_set_hidden_subscribers' ) ;
    add_action ('bbp_topic_attributes_metabox_save' , 'rew_save_subscriptions', 10 , 2) ;
    
    function rew_set_hidden_subscribers ($post) {
    	// Get user IDs
    	$user_ids = bbp_get_subscribers( $post->ID );
    	$list = implode(",",$user_ids); 
    
    	// Output
    	?>
    	<input name="rew_topic_subscription" id="rew_topic_subscription" type="hidden" value="<?php echo $list; ?>" />
    	<?php
    }
    
    function rew_save_subscriptions ( $topic_id, $forum_id ) {
    	// Handle Subscriptions
    	if ( bbp_is_subscriptions_active() && ! empty( $_POST['rew_topic_subscription'] )) {
    		//update_option ($subscriptions)
    		$subscriptions = explode(",", $_POST['rew_topic_subscription']);
    		foreach ($subscriptions as $subscription_id ) {
    			// Check if subscribed and if so do nothing
    			if (bbp_is_user_subscribed( $subscription_id, $topic_id )) continue;
    			else {
    			bbp_add_user_subscription( $subscription_id, $topic_id );
    			}
    		}
    	}
    }

    Put this in your child theme’s function file –

    ie wp-content/themes/%your-theme-name%/functions.php

    where %your-theme-name% is the name of your theme

    or use

    Code Snippets

    or if you use

    bbp style pack

    this fix is automatically added

    @stonebkfly

    Participant

    Thank you! The issue turned out to be I was entering the wrong username in the Forum Moderators textbox. I was using the WP Username (user_login field on users table) but when I used the encoded email address it excepted it. Eg. If the email was name@domain.com I needed to use name-domain-com.

    @robin-w

    Moderator

    ok, glad you are fixed

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