Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for '+.+default+.+'

Viewing 25 results - 1,126 through 1,150 (of 6,777 total)
  • Author
    Search Results
  • #191815

    Topic: add new roles

    in forum Installation
    veepay
    Participant

    Hello,
    I would like to create new roles in bbpress.
    Since this is not easy, I have used this code

    /**
     * Neue Benutzerrollen
     */
    function add_new_roles( $bbp_roles )
    {
        /* Add a role called Super-Administrator */
        $bbp_roles['bbp_super-administrator'] = array(
            'name' => 'Super-Administrator',
            'capabilities' => custom_capabilities( 'bbp_super-administrator' )
            );
    
        /* Add a role called Administrator */
        $bbp_roles['bbp_administrator'] = array(
            'name' => 'Administrator',
            'capabilities' => custom_capabilities( 'bbp_administrator' )
            );
    
        /* Add a role called VIP-Member */
        $bbp_roles['bbp_vip-member'] = array(
            'name' => 'VIP-Member',
            'capabilities' => custom_capabilities( 'bbp_vip-member' )
            );
    
        /* Add a role called Member */
        $bbp_roles['bbp_member'] = array(
            'name' => 'Member',
            'capabilities' => custom_capabilities( 'bbp_member' )
            );
    
        /* Add a role called Trial-Member */
        $bbp_roles['bbp_trial-member'] = array(
            'name' => 'Trial-Member',
            'capabilities' => custom_capabilities( 'bbp_trial-member' )
            );
    
        /* Add a role called User */
        $bbp_roles['bbp_user'] = array(
            'name' => 'User',
            'capabilities' => custom_capabilities( 'bbp_User' )
            );
     
        return $bbp_roles;
    }
     
    add_filter( 'bbp_get_dynamic_roles', 'add_new_roles', 1 );
     
    function add_role_caps_filter( $caps, $role )
    {
        /* Only filter for roles we are interested in! */
        if( $role == 'bbp_super-administrator' )
            $caps = custom_capabilities( $role );
    
        if( $role == 'bbp_administrator' )
            $caps = custom_capabilities( $role );
    
        if( $role == 'bbp_vip-member' )
            $caps = custom_capabilities( $role );
    
        if( $role == 'bbp_member' )
            $caps = custom_capabilities( $role );
    
        if( $role == 'bbp_trial-member' )
            $caps = custom_capabilities( $role );
    
        if( $role == 'bbp_user' )
            $caps = custom_capabilities( $role );
       
        return $caps;
    }
     
    add_filter( 'bbp_get_caps_for_role', 'add_role_caps_filter', 10, 2 );
     
    function custom_capabilities( $role )
    {
        switch ( $role )
        {
     
            /* Capabilities for 'Super-Administrator' role */
            case 'bbp_super-administrator':
                return array(
                
    				// Keymasters only
    				'keep_gate'             => true,
    
    				// Primary caps
    				'spectate'              => true,
    				'participate'           => true,
    				'moderate'              => true,
    				'throttle'              => true,
    				'view_trash'            => true,
    
    				// Forum caps
    				'publish_forums'        => true,
    				'edit_forums'           => true,
    				'edit_others_forums'    => true,
    				'delete_forums'         => true,
    				'delete_others_forums'  => true,
    				'read_private_forums'   => true,
    				'read_hidden_forums'    => true,
    
    				// Topic caps
    				'publish_topics'        => true,
    				'edit_topics'           => true,
    				'edit_others_topics'    => true,
    				'delete_topics'         => true,
    				'delete_others_topics'  => true,
    				'read_private_topics'   => true,
    
    				// Reply caps
    				'publish_replies'       => true,
    				'edit_replies'          => true,
    				'edit_others_replies'   => true,
    				'delete_replies'        => true,
    				'delete_others_replies' => true,
    				'read_private_replies'  => true,
    
    				// Topic tag caps
    				'manage_topic_tags'     => true,
    				'edit_topic_tags'       => true,
    				'delete_topic_tags'     => true,
    				'assign_topic_tags'     => true
                );
    
            /* Capabilities for 'Administrator' role */
            case 'bbp_administrator':
                return array(
                
    				// Primary caps
    				'spectate'              => true,
    				'participate'           => true,
    				'moderate'              => true,
    				'throttle'              => true,
    				'view_trash'            => true,
    
    				// Forum caps
    				'publish_forums'        => true,
    				'edit_forums'           => true,
    				'read_private_forums'   => true,
    				'read_hidden_forums'    => true,
    
    				// Topic caps
    				'publish_topics'        => true,
    				'edit_topics'           => true,
    				'edit_others_topics'    => true,
    				'delete_topics'         => true,
    				'delete_others_topics'  => true,
    				'read_private_topics'   => true,
    
    				// Reply caps
    				'publish_replies'       => true,
    				'edit_replies'          => true,
    				'edit_others_replies'   => true,
    				'delete_replies'        => true,
    				'delete_others_replies' => true,
    				'read_private_replies'  => true,
    
    				// Topic tag caps
    				'manage_topic_tags'     => true,
    				'edit_topic_tags'       => true,
    				'delete_topic_tags'     => true,
    				'assign_topic_tags'     => true,
    			);
    
            /* Capabilities for 'VIP-Member' role */
            case 'bbp_vip-member':
                return array(
                
    				// Primary caps
    				'spectate'              => true,
    				'participate'           => true,
    
    				// Forum caps
    				'read_private_forums'   => true,
    
    				// Topic caps
    				'publish_topics'        => true,
    				'edit_topics'           => true,
    
    				// Reply caps
    				'publish_replies'       => true,
    				'edit_replies'          => true,
    
    				// Topic tag caps
    				'assign_topic_tags'     => true,
    			);
    
            /* Capabilities for 'Member' role */
            case 'bbp_member':
                return array(
                
    				// Primary caps
    				'spectate'              => true,
    				'participate'           => true,
    
    				// Forum caps
    				'read_private_forums'   => true,
    
    				// Topic caps
    				'publish_topics'        => true,
    				'edit_topics'           => true,
    
    				// Reply caps
    				'publish_replies'       => true,
    				'edit_replies'          => true,
    
    				// Topic tag caps
    				'assign_topic_tags'     => true,
    			);
    
            /* Capabilities for 'Trial-Member' role */
            case 'bbp_trial-member':
                return array(
                
    				// Primary caps
    				'spectate'              => true,
    				'participate'           => true,
    
    				// Forum caps
    				'read_private_forums'   => true,
    
    				// Topic caps
    				'publish_topics'        => true,
    				'edit_topics'           => true,
    
    				// Reply caps
    				'publish_replies'       => true,
    				'edit_replies'          => true,
    
    				// Topic tag caps
    				'assign_topic_tags'     => true,
    			);
    
            /* Capabilities for 'User' role */
            case 'bbp_user':
                return array(
                
    				// Primary caps
    				'spectate'              => true,
    				'participate'           => true,
    
    				// Forum caps
    				'read_private_forums'   => true,
    
    				// Topic caps
    				'publish_topics'        => true,
    				'edit_topics'           => true,
    
    				// Reply caps
    				'publish_replies'       => true,
    				'edit_replies'          => true,
    
    				// Topic tag caps
    				'assign_topic_tags'     => true,
    			);
     
                break;
     
            default :
                return $role;
        }
    }

    Unfortunately, I have the problem that the rights are all set to deny, as soon as the user changes something in his profile.
    Can I prevent that?

    In addition I have installed the plugin “bbPress Advanced Capabilities”

    VeePay

    #191725

    In reply to: 404s

    Robin W
    Moderator

    can only suggest

    It could be a theme or plugin issue

    Plugins

    Deactivate all but bbpress and see if this fixes. if it does, re-enable one at a time to see which is causing the error.

    Themes

    If plugins don’t pinpoint the problem, as a test switch to a default theme such as twentyfifteen, and see if this fixes.

    Then come back

    #191699
    Robin W
    Moderator

    so it is wordpress not bbpress

    It could be a theme or plugin issue

    Plugins

    Deactivate all but bbpress and see if this fixes. if it does, re-enable one at a time to see which is causing the error.

    Themes

    If plugins don’t pinpoint the problem, as a test switch to a default theme such as twentyfifteen, and see if this fixes.

    Then come back

    #191671
    loiruca
    Participant

    Hi, the admin email has been set up with the domain name. All plugins have been deactivated and default theme has been tested. he email is not sending to the user. I’m receiving a notification that a new user has been registered but the user is not receiving the email. We are losing people on your forums because of this issue.

    #191670
    Robin W
    Moderator

    It could be a theme or plugin issue

    Plugins

    Deactivate all but bbpress and see if this fixes. if it does, re-enable one at a time to see which is causing the error.

    Themes

    If plugins don’t pinpoint the problem, as a test switch to a default theme such as twentyfifteen, and see if this fixes.

    Then come back

    #191640
    Robin W
    Moderator

    It could be a theme or plugin issue

    Plugins

    Deactivate all but bbpress and see if this fixes. if it does, re-enable one at a time to see which is causing the error.

    Themes

    If plugins don’t pinpoint the problem, as a test switch to a default theme such as twentyfifteen, and see if this fixes.

    Then come back

    #191614
    p1s4
    Participant

    I know this topic is very old, but is the most recent i found about this argument.

    I need different colors for authors link ( topic and replys) .

    I solved using the filters bbp_get_reply_author_link and bbp_get_topic_author_link in function.php of my child theme.

    I changed the class $link_class in $author_link, you can found the original code in bbpress/includes/topics/template.php and bbpress/includes/reply/template.php.

    This is the complete code in my function.php child’s theme:

    //custom color LINK AUTHOR roles
    add_filter( 'bbp_get_reply_author_link', 'addrole_reply_author_links', 10, 2);
    add_filter( 'bbp_get_topic_author_link', 'addrole_topic_author_links', 10, 2);
    function addrole_topic_author_links($author_link, $args) {
    // Parse arguments against default values
    		$r = bbp_parse_args( $args, array(
    			'post_id'    => 0,
    			'link_title' => '',
    			'type'       => 'both',
    			'size'       => 80,
    			'sep'        => ' ',
    			'show_role'  => false
    		), 'get_topic_author_link' );
    
    		// Used as topic_id
    		if ( is_numeric( $args ) ) {
    			$topic_id = bbp_get_topic_id( $args );
    		} else {
    			$topic_id = bbp_get_topic_id( $r['post_id'] );
    		}
    
    		// Topic ID is good
    		if ( !empty( $topic_id ) ) {
    
    			// Get some useful topic information
    			$author_url = bbp_get_topic_author_url( $topic_id );
    			$anonymous  = bbp_is_topic_anonymous( $topic_id );
    
    			// Tweak link title if empty
    			if ( empty( $r['link_title'] ) ) {
    				$link_title = sprintf( empty( $anonymous ) ? __( 'View %s\'s profile', 'bbpress' ) : __( 'Visit %s\'s website', 'bbpress' ), bbp_get_topic_author_display_name( $topic_id ) );
    
    			// Use what was passed if not
    			} else {
    				$link_title = $r['link_title'];
    			}
    
    			// Setup title and author_links array
    			$link_title   = !empty( $link_title ) ? ' title="' . esc_attr( $link_title ) . '"' : '';
    			$author_links = array();
    
    			// Get avatar
    			if ( 'avatar' === $r['type'] || 'both' === $r['type'] ) {
    				$author_links['avatar'] = bbp_get_topic_author_avatar( $topic_id, $r['size'] );
    			}
    
    			// Get display name
    			if ( 'name' === $r['type'] || 'both' === $r['type'] ) {
    				$author_links['name'] = bbp_get_topic_author_display_name( $topic_id );
    			}
    
    			// Link class
    			//ADD ROLE CLASS TO LINK 
    			$role        = str_replace(' ', '-', strtolower(bbp_get_user_display_role( bbp_get_topic_author_id( $topic_id )) ));
    			$link_class = ' class="'.$role.' bbp-author-' . esc_attr( $r['type'] ) . '"';
    
    			// Add links if not anonymous
    			if ( empty( $anonymous ) && bbp_user_has_profile( bbp_get_topic_author_id( $topic_id ) ) ) {
    
    				$author_link = array();
    
    				// Assemble the links
    				foreach ( $author_links as $link => $link_text ) {
    					//ADD ROLE CLASS TO LINK 
    					$role        =  str_replace(' ', '-', strtolower(bbp_get_user_display_role( bbp_get_topic_author_id( $topic_id )) ));
    					$link_class = ' class="'.$role.'  bbp-author-' . esc_attr( $link ) . '"';
    					$author_link[] = sprintf( '<a href="%1$s"%2$s%3$s>%4$s</a>', esc_url( $author_url ), $link_title, $link_class, $link_text );
    				}
    
    				if ( true === $r['show_role'] ) {
    					$author_link[] = bbp_get_topic_author_role( array( 'topic_id' => $topic_id ) );
    				}
    
    				$author_link = implode( $r['sep'], $author_link );
    
    			// No links if anonymous
    			} else {
    				$author_link = implode( $r['sep'], $author_links );
    			}
    
    		} else {
    			$author_link = '';
    		}
    
    return $author_link;
    }
    
    function addrole_reply_author_links($author_link, $args) {
    
    		// Parse arguments against default values
    		$r = bbp_parse_args( $args, array(
    			'post_id'    => 0,
    			'link_title' => '',
    			'type'       => 'both',
    			'size'       => 80,
    			'sep'        => '&nbsp;',
    			'show_role'  => false
    		), 'get_reply_author_link' );
    
    		// Used as reply_id
    		if ( is_numeric( $args ) ) {
    			$reply_id = bbp_get_reply_id( $args );
    		} else {
    			$reply_id = bbp_get_reply_id( $r['post_id'] );
    		}
    
    		// Reply ID is good
    		if ( !empty( $reply_id ) ) {
    
    			// Get some useful reply information
    			$author_url = bbp_get_reply_author_url( $reply_id );
    			$anonymous  = bbp_is_reply_anonymous( $reply_id );
    
    			// Tweak link title if empty
    			if ( empty( $r['link_title'] ) ) {
    				$link_title = sprintf( empty( $anonymous ) ? __( 'View %s\'s profile', 'bbpress' ) : __( 'Visit %s\'s website', 'bbpress' ), bbp_get_reply_author_display_name( $reply_id ) );
    
    			// Use what was passed if not
    			} else {
    				$link_title = $r['link_title'];
    			}
    
    			// Setup title and author_links array
    			$link_title   = !empty( $link_title ) ? ' title="' . esc_attr( $link_title ) . '"' : '';
    			$author_links = array();
    
    			// Get avatar
    			if ( 'avatar' === $r['type'] || 'both' === $r['type'] ) {
    				$author_links['avatar'] = bbp_get_reply_author_avatar( $reply_id, $r['size'] );
    			}
    
    			// Get display name
    			if ( 'name' === $r['type']   || 'both' === $r['type'] ) {
    				$author_links['name'] = bbp_get_reply_author_display_name( $reply_id );
    			}
    
    			// Link class
    			//ADD ROLE CLASS TO LINK  
    			$role        =  str_replace(' ', '-', strtolower(bbp_get_user_display_role( bbp_get_reply_author_id( $reply_id ) )));
    			$link_class = ' class="'.$role.' bbp-author-' . esc_attr( $r['type'] ) . '"';
    
    			// Add links if not anonymous and existing user
    			if ( empty( $anonymous ) && bbp_user_has_profile( bbp_get_reply_author_id( $reply_id ) ) ) {
    
    				$author_link = array();
    
    				// Assemble the links
    				foreach ( $author_links as $link => $link_text ) {
    					//ADD ROLE CLASS TO LINK 
    					$role        =  str_replace(' ', '-', strtolower(bbp_get_user_display_role( bbp_get_reply_author_id( $reply_id ) )));
    					$link_class = ' class="'.$role.'  bbp-author-' . $link . '"';
    					$author_link[] = sprintf( '<a href="%1$s"%2$s%3$s>%4$s</a>', esc_url( $author_url ), $link_title, $link_class, $link_text );
    				}
    
    				if ( true === $r['show_role'] ) {
    					$author_link[] = bbp_get_reply_author_role( array( 'reply_id' => $reply_id ) );
    				}
    
    				$author_link = implode( $r['sep'], $author_link );
    
    			// No links if anonymous
    			} else {
    				$author_link = implode( $r['sep'], $author_links );
    			}
    
    		// No replies so link is empty
    		} else {
    			$author_link = '';
    		}
    
    		return $author_link;
    	}

    Then you have to add the CSS to the new class added to author’s link.

    Hope will be useful,
    bye,
    Marco.

    #191480
    Robin W
    Moderator

    I can’t replicate this

    It could be a theme or plugin issue

    Plugins

    Deactivate all but bbpress and see if this fixes. if it does, re-enable one at a time to see which is causing the error.

    Themes

    If plugins don’t pinpoint the problem, as a test switch to a default theme such as twentyfifteen, and see if this fixes.

    Then come back

    #191479
    Robin W
    Moderator

    It could be a theme or plugin issue

    Plugins

    Deactivate all but bbpress and see if this fixes. if it does, re-enable one at a time to see which is causing the error.

    Themes

    If plugins don’t pinpoint the problem, as a test switch to a default theme such as twentyfifteen, and see if this fixes.

    Then come back

    #191453
    Robin W
    Moderator

    bbpress uses the wordpress default avatar as set in

    dashboard>settings>discussion

    There are plugins that let you add additional defaults eg

    Add New Default Avatar

    or use code in your functions file or a snippets plugin (https://en-gb.wordpress.org/plugins/code-snippets/) such as

    add_filter( 'avatar_defaults', 'mytheme_default_avatar' );
    function mytheme_default_avatar( $avatar_defaults ) 
    {
        $avatar = get_option('avatar_default');
    
        $new_avatar_url = get_template_directory_uri() . '/images/default_avatar.png';
    
        if( $avatar != $new_avatar_url )
        {
            update_option( 'avatar_default', $new_avatar_url );
        }
    
        $avatar_defaults[ $new_avatar_url ] = 'Default Avatar';
        return $avatar_defaults;
    }
    #191438
    Robin W
    Moderator

    bbpress just uses the display name as set in

    dashboard>users>all Users>edit user

    so you could change your users to what you want.

    users can change their individual if you give them access to their wordpress profile or their bbpress profile.

    There are some plugins and code that can change stuff eg

    Quick Tip: Set the Default Display Name for WordPress Users

    I googled ‘wordpress change display name for all users’ and lots lots of stuff.

    #191347
    Pascal Casier
    Moderator

    @fabioweb

    Ciao Fabio,
    As you can see on https://translate.wordpress.org/locale/it/default/wp-plugins/bbpress , bbPress is translated in stable and dev at 100%, so I confirm that all strings have been translated in Italian.

    What you show in your screenshots is however coming from a theme or an extra plugin and not from bbPress.

    So identify the theme or plugin that adds this string and translate it. More information on how to translate can be found on https://it.wordpress.org/traduzioni/

    #191278
    Robin W
    Moderator

    It could be a theme or plugin issue

    Plugins

    Deactivate all but bbpress and see if this fixes. if it does, re-enable one at a time to see which is causing the error.

    Themes

    If plugins don’t pinpoint the problem, as a test switch to a default theme such as twentyfifteen, and see if this fixes.

    Then come back

    #191274
    tvirtual
    Participant

    I am looking to do just what the original poster was looking for:
    When a user creates a new topic, the menu assigned to this new topic should be the same menu as the forum. It is currently using the default WordPress menu. Can someone point me to the right code and where to add it to automatically assign the right menu to new topics? I appreciate your help.

    #191252

    In reply to: editing post template

    Robin W
    Moderator

    these are the files you are after

    bbpress/templates/default/bbpress/form-topic.php and
    bbpress/templates/default/bbpress/form-reply.php

    #191251
    hanza3
    Participant

    I’m looking to do something relatively simple – move the tags in a single topic post up under the title, rather than under the search bar – their default position.

    I’ve been going through to files to try and figure out where this code would be but since there are so many files in default > bbpress I was hoping to get some direction on where to find the relevant code.

    Thanks!

    #191209
    Robin W
    Moderator

    you can never guarantee that every plugin will work with every other plugin or combination of plugins and settings.

    suggest you :

    Plugins

    Deactivate all but bbpress and see if this fixes. if it does, re-enable one at a time to see which is causing the error.

    Themes

    If plugins don’t pinpoint the problem, as a test switch to a default theme such as twentyfifteen, and see if this fixes.

    Then come back

    #191160
    erich199
    Participant

    Hi @robin-w,

    I managed to get this to work with this code
    I needed a custom role and I also needed to reorder it in my legend. This code made it work

    //BBpress Custom Roles // 
    function add_role_caps_filter( $caps, $role )
    {
        /* Only filter for roles we are interested in! */
        if( $role == 'bbp_lead' )
            $caps = custom_capabilities( $role );
     
        return $caps;
    }
     
    add_filter( 'bbp_get_caps_for_role', 'add_role_caps_filter', 10, 2 );
     
    function custom_capabilities( $role )
    {
        switch ( $role )
        {
     
            /* Capabilities for 'tutor' role */
            case 'bbp_lead':
                return array(
                    // Primary caps
                    'spectate'              => true,
                    'participate'           => true,
                    'moderate'              => true,
                    'throttle'              => false,
                    'view_trash'            => false,
     
                    // Forum caps
                    'publish_forums'        => false,
                    'edit_forums'           => false,
                    'edit_others_forums'    => false,
                    'delete_forums'         => false,
                    'delete_others_forums'  => false,
                    'read_private_forums'   => true,
                    'read_hidden_forums'    => true,
     
                    // Topic caps
                    'publish_topics'        => true,
                    'edit_topics'           => true,
                    'edit_others_topics'    => true,
                    'delete_topics'         => true,
                    'delete_others_topics'  => true,
                    'read_private_topics'   => true,
     
                    // Reply caps
                    'publish_replies'       => true,
                    'edit_replies'          => true,
                    'edit_others_replies'   => true,
                    'delete_replies'        => true,
                    'delete_others_replies' => true,
                    'read_private_replies'  => true,
     
                    // Topic tag caps
                    'manage_topic_tags'     => true,
                    'edit_topic_tags'       => true,
                    'delete_topic_tags'     => true,
                    'assign_topic_tags'     => true,
                );
     
                break;
     
            default :
                return $role;
        }
    }
    // End BBpress Custom Roles //
    
    //BBpress Rename Roles //
    add_filter( 'bbp_get_dynamic_roles', 'ntwb_bbpress_custom_role_names' );
    function ntwb_bbpress_custom_role_names() {
        return array(
    		// Keymaster
    		bbp_get_keymaster_role() => array(
    		'name' => 'Administrator',
    		'capabilities' => bbp_get_caps_for_role( bbp_get_keymaster_role() )
    		),
    		'bbp_lead' => array(
            'name' => 'Community Lead',
            'capabilities' => custom_capabilities( 'bbp_lead' )
            ),
    		// Moderator
    		bbp_get_moderator_role() => array(
    		'name' => 'Moderator',
    		'capabilities' => bbp_get_caps_for_role( bbp_get_moderator_role() )
    		),
    		// Participant
    		bbp_get_participant_role() => array(
    		'name' => 'Member',
    		'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() )
    		),
    		// Spectator
    		bbp_get_spectator_role() => array(
    		'name' => 'Spectator',
    		'capabilities' => bbp_get_caps_for_role( bbp_get_spectator_role() )
    		),
    		// Blocked
    		bbp_get_blocked_role() => array(
    		'name' => 'Blocked',
    		'capabilities' => bbp_get_caps_for_role( bbp_get_blocked_role() )
    		)
    	);
    }
    //BBpress Rename Roles End //
    #191141
    Robin W
    Moderator

    The 2nd function assumes that you only have the default roles.

    Put this first and it should work ie

    //BBpress Rename Roles //
         /* BBPress Renaming Roles */
        add_filter( 'bbp_get_dynamic_roles', 'ntwb_bbpress_custom_role_names' , 1);
        function ntwb_bbpress_custom_role_names() {
        return array(
        // Keymaster
        bbp_get_keymaster_role() => array(
        'name' => 'Administrator',
        'capabilities' => bbp_get_caps_for_role( bbp_get_keymaster_role() )
        ),
        // Moderator
        bbp_get_moderator_role() => array(
        'name' => 'Moderator',
        'capabilities' => bbp_get_caps_for_role( bbp_get_moderator_role() )
        ),
        // Participant
        bbp_get_participant_role() => array(
        'name' => 'Member',
        'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() )
        ),
        // Spectator
        bbp_get_spectator_role() => array(
        'name' => 'Spectator',
        'capabilities' => bbp_get_caps_for_role( bbp_get_spectator_role() )
        ),
        // Blocked
        bbp_get_blocked_role() => array(
        'name' => 'Blocked',
        'capabilities' => bbp_get_caps_for_role( bbp_get_blocked_role() )
        ));}
    //BBpress Rename Roles End //
    
    //BBpress Custom Roles // 
    function add_new_roles( $bbp_roles )
    {
        /* Add a role called tutor */
        $bbp_roles['bbp_lead'] = array(
            'name' => 'Community Lead',
            'capabilities' => custom_capabilities( 'bbp_lead' )
            );
     
        return $bbp_roles;
    }
     
    add_filter( 'bbp_get_dynamic_roles', 'add_new_roles', 1 );
     
    function add_role_caps_filter( $caps, $role )
    {
        /* Only filter for roles we are interested in! */
        if( $role == 'bbp_lead' )
            $caps = custom_capabilities( $role );
     
        return $caps;
    }
     
    add_filter( 'bbp_get_caps_for_role', 'add_role_caps_filter', 10, 2 );
     
    function custom_capabilities( $role )
    {
        switch ( $role )
        {
     
            /* Capabilities for 'tutor' role */
            case 'bbp_lead':
                return array(
                    // Primary caps
                    'spectate'              => true,
                    'participate'           => true,
                    'moderate'              => true,
                    'throttle'              => false,
                    'view_trash'            => false,
     
                    // Forum caps
                    'publish_forums'        => false,
                    'edit_forums'           => false,
                    'edit_others_forums'    => false,
                    'delete_forums'         => false,
                    'delete_others_forums'  => false,
                    'read_private_forums'   => true,
                    'read_hidden_forums'    => true,
     
                    // Topic caps
                    'publish_topics'        => true,
                    'edit_topics'           => true,
                    'edit_others_topics'    => true,
                    'delete_topics'         => true,
                    'delete_others_topics'  => true,
                    'read_private_topics'   => true,
     
                    // Reply caps
                    'publish_replies'       => true,
                    'edit_replies'          => true,
                    'edit_others_replies'   => true,
                    'delete_replies'        => true,
                    'delete_others_replies' => true,
                    'read_private_replies'  => true,
     
                    // Topic tag caps
                    'manage_topic_tags'     => true,
                    'edit_topic_tags'       => true,
                    'delete_topic_tags'     => true,
                    'assign_topic_tags'     => true,
                );
     
                break;
     
            default :
                return $role;
        }
    }
    // End BBpress Custom Roles //
    #191125
    kingofblingbling
    Participant

    It’s under the title “Forum” in the bar/header; I think is to default for all but I can explain better if you dont understand.

    #191095
    wpturk
    Participant

    I use this to change default Profile URL (author link) to my custom Profile Page URL.

    How can I also change mention links to my custom profile page url?

    (bbpress 2.6 RC5)

    #191057
    erich199
    Participant

    Hello,
    I’m trying to rename the current roles as well as ADD new roles. When I add the filter to change the current role name, it doesn’t add the new user role I’ve added. If I remove that code, then the new user role shows up.

    This is the code I’m using.

    //BBpress Custom Roles // 
    function add_new_roles( $bbp_roles )
    {
        /* Add a role called tutor */
        $bbp_roles['bbp_lead'] = array(
            'name' => 'Community Lead',
            'capabilities' => custom_capabilities( 'bbp_lead' )
            );
     
        return $bbp_roles;
    }
     
    add_filter( 'bbp_get_dynamic_roles', 'add_new_roles', 1 );
     
    function add_role_caps_filter( $caps, $role )
    {
        /* Only filter for roles we are interested in! */
        if( $role == 'bbp_lead' )
            $caps = custom_capabilities( $role );
     
        return $caps;
    }
     
    add_filter( 'bbp_get_caps_for_role', 'add_role_caps_filter', 10, 2 );
     
    function custom_capabilities( $role )
    {
        switch ( $role )
        {
     
            /* Capabilities for 'tutor' role */
            case 'bbp_lead':
                return array(
                    // Primary caps
                    'spectate'              => true,
                    'participate'           => true,
                    'moderate'              => true,
                    'throttle'              => false,
                    'view_trash'            => false,
     
                    // Forum caps
                    'publish_forums'        => false,
                    'edit_forums'           => false,
                    'edit_others_forums'    => false,
                    'delete_forums'         => false,
                    'delete_others_forums'  => false,
                    'read_private_forums'   => true,
                    'read_hidden_forums'    => true,
     
                    // Topic caps
                    'publish_topics'        => true,
                    'edit_topics'           => true,
                    'edit_others_topics'    => true,
                    'delete_topics'         => true,
                    'delete_others_topics'  => true,
                    'read_private_topics'   => true,
     
                    // Reply caps
                    'publish_replies'       => true,
                    'edit_replies'          => true,
                    'edit_others_replies'   => true,
                    'delete_replies'        => true,
                    'delete_others_replies' => true,
                    'read_private_replies'  => true,
     
                    // Topic tag caps
                    'manage_topic_tags'     => true,
                    'edit_topic_tags'       => true,
                    'delete_topic_tags'     => true,
                    'assign_topic_tags'     => true,
                );
     
                break;
     
            default :
                return $role;
        }
    }
    // End BBpress Custom Roles //
    
    //BBpress Rename Roles //
         /* BBPress Renaming Roles */
        add_filter( 'bbp_get_dynamic_roles', 'ntwb_bbpress_custom_role_names' );
        function ntwb_bbpress_custom_role_names() {
        return array(
        // Keymaster
        bbp_get_keymaster_role() => array(
        'name' => 'Administrator',
        'capabilities' => bbp_get_caps_for_role( bbp_get_keymaster_role() )
        ),
        // Moderator
        bbp_get_moderator_role() => array(
        'name' => 'Moderator',
        'capabilities' => bbp_get_caps_for_role( bbp_get_moderator_role() )
        ),
        // Participant
        bbp_get_participant_role() => array(
        'name' => 'Member',
        'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() )
        ),
        // Spectator
        bbp_get_spectator_role() => array(
        'name' => 'Spectator',
        'capabilities' => bbp_get_caps_for_role( bbp_get_spectator_role() )
        ),
        // Blocked
        bbp_get_blocked_role() => array(
        'name' => 'Blocked',
        'capabilities' => bbp_get_caps_for_role( bbp_get_blocked_role() )
        ));}
    //BBpress Rename Roles End //
    #191056

    In reply to: list of all functions

    Robin W
    Moderator

    would love to find the time to write it!!

    Like all open software bbpress relies on users to make it successful, and I’m not a bbpress author, just a user who got into it, and I wrote much of the ‘getting started’ guide as I installed my first bbpress site.

    If you want to help, then as above the key start point is the templates. Mapping these into a user understandable chart would be a great start, so go to

    bbpress/templates/default/bbress/content-archive-forum.php
    This is the first template called, and all the functions and templates you want to use will cascade from here.

    #190981

    In reply to: Private Threads?

    Robin W
    Moderator

    It wouldn’t be the same ticket thread. Perhaps I’m not explaining myself clearly.

    The previous comment was spam promoting a dentist site which I have deleted, so ignore that.

    On private groups.

    You would set up a group say called ‘users’

    You would set up two forums – one public where public posts can be posted as per standard bbpress, and then one that belongs to the private group ‘users’ which you set up above.

    Users are joined to users group either manually or by default.

    You then enable topic permissions opn the private forum, and set the topic permisisons for that group to Create/edit OWN topics. Users will only see their own topics and any replies posted.

    If just keymasters are responding, then they will see all topics on that forum. If others will be responding, then set up another group and make them able to see the whole forum.

    #190942
    bhammondCVL
    Participant

    No worries–I am looking forward to a nice weekend myself. Here are some more, possibly useful, details:

    I installed bbPress on another, far more generic, site and got the same behavior–bounced messages to no-reply@site-name if any user had subscribed to a forum or topic.

    I installed the plugin “bbPress Custom Topic & Reply Notifications” by Pippin Williamson and got its customized notifications, but also the no-reply bounces.

    I deactivated that and installed “bbPress Notify (No-Spam)” by Vinny Alves, which said it provided the ability to override bbPress’s default subscription functions. Using this plugin seems to have resolved the bounces.

    So it would seem to be a problem with bbPress’s subscriptions functions, and not a conflict with some other plugin or some other site-specific oddity.

Viewing 25 results - 1,126 through 1,150 (of 6,777 total)
Skip to toolbar