Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 4,326 through 4,350 (of 32,518 total)
  • Author
    Search Results
  • MWCreative
    Participant

    I’ve been digging around trying to find a way to move topics between forums and found a nice way to do it with php – I’ve posted the code and explanation here in case anyone is struggling:

    Bulk Move bbPress Topics PHP

    #193011
    MWCreative
    Participant

    Just in case anyone needs to alter the forum of topics manually with PHP:

    1. Find the Forum ID you’re moving topics to.
    2. Create a function to search for your required topics and set the ‘post_parent’ as the forum ID. (sample below)
    3. Set the topic’s post meta fields ‘bbp_topic_forum’, ‘_bbp_topic_forum’ and ‘_bbp_forum_id’ as the Forum ID.
    4. Repair the forums (tools->forums)

    After these steps you should see your topics in the correct forum!

    Place in functions.php file of your child theme and modify to your needs, then call the function:
    ** Disclaimer! I’m not responsible for breaking your site! backup your install before using this code to change your topics! **

    function mwc_change_forum_topic_ties() {
            
            // 18 was my target forum ID.  get yours.
    	$forumid = '18';
    	
    	$args = array(
    		'post_type' => 'topic',
    		'post_status' => 'publish',
    		'posts_per_page' => -1,
    	);
    
            /* uncomment this to filter your topics by something
    
            $oldForumID = '10'; //change this to target a specific forum
            $args['meta_query'] = array(
                    'meta_key' => 'bbp_topic_forum',
                    'meta_value' => $oldForumID,
                    'compare' => '='
            );
    
            */
    	
    	$query = new WP_Query( $args );
    	
    	if($query->have_posts()):
    		while($query->have_posts()):
    			$query->the_post();
    			$theid = get_the_ID();
    			
    			$theargs = array(
    				'ID' => $theid,
    				'post_parent' => $forumid
    			);
    			
    			wp_update_post($theargs);
    			
    			update_post_meta($theid, 'bbp_topic_forum', $forumid);
    			update_post_meta($theid, '_bbp_topic_forum', $forumid);
    			update_post_meta($theid, '_bbp_forum_id', $forumid);
    			update_post_meta($theid, '_bbp_topic_id', $theid);
    			
    		endwhile;	
    	endif;
    
    }
    #193002

    In reply to: GDPR Compliance

    Ari Stathopoulos
    Participant

    The only thing that I found has to go away 100% is IP-logging.
    It is no longer legal to display IPs publicly like bbPress currently does.

    On my site it was pretty simple to do using this:

    add_filter( 'bbp_current_author_ip', function() {
    	return '127.0.0.1';
    } );
    #192991
    agricolan
    Participant
    willallen83
    Participant

    Hi!

    I am trying to make any topics and replies submitted on the front end have a default category (I have extended the custom post type of bbPress to support categories). This works for everything submitted on the back end, but not everything submitted on the front end. I have played around with this a lot, and have not made any progress.

    I am using WordPress 4.9.5, bbPress 2.5.14 and the site I am working on (locked so this link probably won’t do any good) is https://gateway.aishasalem.com

        // adding possibilities to have categories for custom post types
        public function gt_custom_post_type_categories() {
          register_taxonomy_for_object_type( 'category', 'topic' );
          register_taxonomy_for_object_type( 'category', 'reply' );
        }
        add_action( 'init', 'gt_custom_post_type_categories', 11 );

    And this code to assign the categories as default when a post is saved / published. It works on the back end, but only partially on the front end.

        // setting default post catagory when saving
        public function gt_set_default_category( $post_id, $post, $update ) {
    
            // Slugs of the custom post types
            $slugs = array('topic', 'reply');
            // current post type
            $current_post_type = $post->post_type;
    
            // If this post isn't a custom posty type, don't update
            if ( !in_array($current_post_type, $slugs) ) {
              return;
            }
    
            // Sets the default category depending on the current post type
            switch ($current_post_type) {
              case 'topic':
                $default_category = 'livingroom-topics';
                break;
              case 'reply':
                $default_category = 'livingroom-replies';   // does not hook in on the fron end
                break;
              default:
                return;
            }
    
            // sets the default category
            $default_term = get_term_by('slug', $default_category, 'category');
            wp_set_object_terms(get_the_ID(), $default_term->term_id, 'category');
        }
        add_action( 'save_post', 'gt_set_default_category', 9, 3 );

    I have tried hooking into ‘bbp_new_reply’ but this doesn’t seem to help (maybe I am doing it wrong). Do you have any advice of how to do this? Where to hook into? If it should be a filter and a function of a different form (if so, please give as much info as possible, I am new to php wordpress and especially filters)?

    Thank you so much!!

    #192965
    scare31125
    Participant

    Hello,
    I have a bbPress site. I want to change some role permission.
    1. Participant Role will be able to delete their post and topic.
    2. Annonymous user can delete their post and reply.
    For number 1. I tried to follow this post but i am very confused. I added this code to theme child function.php

    add_filter ('bbp_get_topic_trash_link', 'topic_dont_delete');
    add_filter ('bbp_get_reply_trash_link', 'reply_dont_delete');
    
    function topic_dont_delete( $args = '') {
    
    		// Parse arguments against default values
    		$r = bbp_parse_args( $args, array(
    			'id'           => 0,
    			'link_before'  => '',
    			'link_after'   => '',
    			'sep'          => ' | ',
    			'trash_text'   => esc_html__( 'Trash',   'bbpress' ),
    			'restore_text' => esc_html__( 'Restore', 'bbpress' ),
    			'delete_text'  => esc_html__( 'Delete',  'bbpress' )
    		), 'get_topic_trash_link' );
    
    		$actions = array();
    		$topic   = bbp_get_topic( bbp_get_topic_id( (int) $r['id'] ) );
    
    		if ( empty( $topic ) || !current_user_can( 'delete_topic', $topic->ID ) ) {
    			return;
    		}
    
    		if ( bbp_is_topic_trash( $topic->ID ) ) {
    			$actions['untrash'] = '<a title="' . esc_attr__( 'Restore this item from the Trash', 'bbpress' ) . '" href="' . esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'bbp_toggle_topic_trash', 'sub_action' => 'untrash', 'topic_id' => $topic->ID ) ), 'untrash-' . $topic->post_type . '_' . $topic->ID ) ) . '" class="bbp-topic-restore-link">' . $r['restore_text'] . '</a>';
    		} elseif ( EMPTY_TRASH_DAYS ) {
    			$actions['trash']   = '<a title="' . esc_attr__( 'Move this item to the Trash',      'bbpress' ) . '" href="' . esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'bbp_toggle_topic_trash', 'sub_action' => 'trash',   'topic_id' => $topic->ID ) ), 'trash-'   . $topic->post_type . '_' . $topic->ID ) ) . '" class="bbp-topic-trash-link">'   . $r['trash_text']   . '</a>';
    		}
    		
    		if ( bbp_is_topic_trash( $topic->ID ) || !EMPTY_TRASH_DAYS ) {
    		if ( bbp_is_user_keymaster()) {
    		$actions['delete']  = '<a title="' . esc_attr__( 'Delete this item permanently',     'bbpress' ) . '" href="' . esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'bbp_toggle_topic_trash', 'sub_action' => 'delete',  'topic_id' => $topic->ID ) ), 'delete-'  . $topic->post_type . '_' . $topic->ID ) ) . '" onclick="return confirm(\'' . esc_js( __( 'Are you sure you want to delete that permanently?', 'bbpress' ) ) . '\' );" class="bbp-topic-delete-link">' . $r['delete_text'] . '</a>';
    		}
    		}
    
    				// Process the admin links
    		$retval = $r['link_before'] . implode( $r['sep'], $actions ) . $r['link_after'];
    
    		return $retval ;
    	}
    	
    	function reply_dont_delete( $args = '' ) {
    
    		// Parse arguments against default values
    		$r = bbp_parse_args( $args, array(
    			'id'           => 0,
    			'link_before'  => '',
    			'link_after'   => '',
    			'sep'          => ' | ',
    			'trash_text'   => esc_html__( 'Trash',   'bbpress' ),
    			'restore_text' => esc_html__( 'Restore', 'bbpress' ),
    			'delete_text'  => esc_html__( 'Delete',  'bbpress' )
    		), 'get_reply_trash_link' );
    
    		$actions = array();
    		$reply   = bbp_get_reply( bbp_get_reply_id( (int) $r['id'] ) );
    
    		if ( empty( $reply ) || !current_user_can( 'delete_reply', $reply->ID ) ) {
    			return;
    		}
    
    		if ( bbp_is_reply_trash( $reply->ID ) ) {
    			$actions['untrash'] = '<a title="' . esc_attr__( 'Restore this item from the Trash', 'bbpress' ) . '" href="' . esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'bbp_toggle_reply_trash', 'sub_action' => 'untrash', 'reply_id' => $reply->ID ) ), 'untrash-' . $reply->post_type . '_' . $reply->ID ) ) . '" class="bbp-reply-restore-link">' . $r['restore_text'] . '</a>';
    		} elseif ( EMPTY_TRASH_DAYS ) {
    			$actions['trash']   = '<a title="' . esc_attr__( 'Move this item to the Trash',      'bbpress' ) . '" href="' . esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'bbp_toggle_reply_trash', 'sub_action' => 'trash',   'reply_id' => $reply->ID ) ), 'trash-'   . $reply->post_type . '_' . $reply->ID ) ) . '" class="bbp-reply-trash-link">'   . $r['trash_text']   . '</a>';
    		}
    
    		if ( bbp_is_reply_trash( $reply->ID ) || !EMPTY_TRASH_DAYS ) {
    		if ( bbp_is_user_keymaster()) {
    		$actions['delete']  = '<a title="' . esc_attr__( 'Delete this item permanently',     'bbpress' ) . '" href="' . esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'bbp_toggle_reply_trash', 'sub_action' => 'delete',  'reply_id' => $reply->ID ) ), 'delete-'  . $reply->post_type . '_' . $reply->ID ) ) . '" onclick="return confirm(\'' . esc_js( __( 'Are you sure you want to delete that permanently?', 'bbpress' ) ) . '\' );" class="bbp-reply-delete-link">' . $r['delete_text'] . '</a>';
    		}
    		}
    
    		// Process the admin links
    		$retval = $r['link_before'] . implode( $r['sep'], $actions ) . $r['link_after'];
    
    		return $retval ;
    	}

    But as I understood that, it was trashing post not deleting them. What I have missed? This code didnot worked for me. May be I have missed some steps.

    And for 2, I don’t know if its possible or not. Searched a lot but haven’t found any solution yet. My understanding is annonymous is not a role, nore a user. So how we can achieve that?

    Thank You

    #192962
    caygri
    Participant

    Hello,

    I use Forum Migrator, but when i try to import user.
    Appear this error:

    Errore sul database di WordPress: [Unknown column 'users.msn' in 'field list']
    SELECT convert(users.uid USING "utf8mb4") AS uid,convert(users.password USING "utf8mb4") AS password,convert(users.salt USING "utf8mb4") AS salt,convert(users.username USING "utf8mb4") AS username,convert(users.email USING "utf8mb4") AS email,convert(users.website USING "utf8mb4") AS website,convert(users.regdate USING "utf8mb4") AS regdate,convert(users.usertitle USING "utf8mb4") AS usertitle,convert(users.aim USING "utf8mb4") AS aim,convert(users.yahoo USING "utf8mb4") AS yahoo,convert(users.icq USING "utf8mb4") AS icq,convert(users.msn USING "utf8mb4") AS msn,convert(users.signature USING "utf8mb4") AS signature FROM mybb_users AS users LIMIT 0, 100

    it’s just 130 user! Not big deal

    #192952
    crista007
    Participant

    The was wrong thing I forgot; for some reason I had issue with it causing a [shortcode] not to work, basically was masked in some way. Love to use jetpack feature but I need the other widget more right now which allows members to upload images.

    #192944
    Robin W
    Moderator

    This can be done, but requires you to be able to use FTP and edit a file

    create a directory on your theme called ‘bbpress’
    ie wp-content/themes/%your-theme-name%/bbpress

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

    find
    wp-content/plugins/bbpress/templates/default/bbpress/content-statistics.php
    Make a copy of this file, and put in in the directory called bbpress that you created above, so you end up with
    wp-content/themes/%your-theme-name%/bbpress/content-statistics.php
    bbPress will now use this template instead of the original
    and you can amend this.

    so open the file and you will see starting at line 17

    <dt><?php _e( 'Registered Users', 'bbpress' ); ?></dt>
    	<dd>
    		<strong><?php echo esc_html( $stats['user_count'] ); ?></strong>
    	</dd>

    remove this and save the file back to wp-content/themes/%your-theme-name%/bbpress/content-statistics.php

    #192928
    dionadk
    Participant

    Robin, I installed the bbp-style-pack plugin. But there is not option to edit a single forum link. I saw options to change home link and forums link.

    I created a Single forum page with short code: [bbp-single-forum id=12]. I disabled the forums slug on the bread crumbs
    step 1: Home Page › Student Forum
    step 2: Home Page › Student Forum › Features of Site Wide Forum

    From here when I click on the student forum it redirects me to the student forum and not the page I created with the student forum short code in it.

    wordpress version: WordPress 4.9.5
    bbpress version: Version 2.5.14

    dionadk
    Participant

    I created a Single forum page with short code: [bbp-single-forum id=12]

    from the single forum page I navigate to one of the topics. when I click on the single forum page link it redirects me to the single forum but not to the page I created. I disabled the forums links in the bread crumbs. Is there a way to edit the link for the single forum so that I could point it the page I created.

    step 1: Home Page › Student Forum
    step 2: Home Page › Student Forum › Features of Site Wide Forum

    From here when I click on the student forum it redirects me to the student forum and not the page I created with the student forum short code in it.

    wordpress version: WordPress 4.9.5
    bbpress version: Version 2.5.14

    #192880
    cpmrgmt
    Participant

    Forum with padding problem and  grey line separator

    I have been trying to identify location and code to change in order to fix padding problem in the body of content/replies forum. Lack of padding makes the first letter of content to be hidden by arrowhead shape /line separating post message from author/date column.

    How could I totally eliminate such vertical grey line/border, and edit/change padding so post text does not appear attached to left?

    #192873
    Audiomonk
    Participant

    I know the subject keeps coming up, and I’ve been through the posts and I’ve added the relevant code to my functions.php all good so far.

    My visual editor is inserting tags that get filtered out by BBpress. Is there any plugin that I can say a particular user can have any html? I’m wanting to add more available tags like <h1 style=”text align:center”> etc. All my efforts have failed miserably. I like BBpress, but other forum software doesn’t have these restrictions on basic text formatting.

    Maybe if you can explain what the code does rather than link to an example, I haven’t a clue about arrays or what => etc means and the syntax. I just want users to be able to add heading tags and a few other basic text formatting options to tie in with their visual editor.

    Thanks in advance

    #192828

    In reply to: Incorrect topics count

    Andrei Surdu
    Participant

    OK. Here is how to replicate the issue.

    1. Make a forum.
    2. Add 2 topic to this forum using the front-end form.

    Now the structure of this forum is something like this:

    -> Example forum
    -> A topic example 1
    -> A topic example 2

    And the count is 2 topics.
    I get this count of 2 topics by using the function: bbp_get_forum_topic_count(0, false).
    This function is placed in bbpress/loop-single-forum.php template.

    3. Go to wp-admin to the edit screen of the topic “A topic example 1”.
    4. Under the “Topic Attributes” meta box, change the forum parent, by selecting “– No parent –“.
    5. Update.
    6. Check the forum on front-end. The count should be 1 topic but it still displays 2 topics.

    #192823

    In reply to: Incorrect topics count

    Robin W
    Moderator

    sorry I don’t understand the question.

    you start by quoting a bbpress function, and then changing a forum and then a ?specific? topic disappears.

    As a start, can you give the precise code you are using, and where you are using it, and how.

    #192822
    Andrei Surdu
    Participant

    I use this function to display the total topics count for a single forum: bbp_get_forum_topic_count

    If I change the forum parent to –No Parent —, the topic dissapears from forum section but the count does not change. See the image below:

    —————–
    bbPress version: 2.5.14
    WordPress version: 4.9.5

    #192821
    emgb_520
    Participant

    I forgot to include that I have tried editing the code without any luck.

    The file I have tried editing is /wp-content/plugins/bbpress-login-register-links-on-forum-topic-pages/bbpress-login-register-links-on-forum-topic-page.php

    Lines 26-72

    The LOGOUT link redirects to the page the user was previously on, but the LOGIN link does not.

    Please help!

    #192801
    hossamhamdy
    Participant

    I do accept that, it’s just the first time I ask was 5 days ago and I stopped working on the website coz I had to solve this problem first.

    Here’s a link to the forum page: https://www.yt-creatorcommunity.com/forums/forum/ساحة-التفاعل/

    I added a custom css to solve the picture problem, so it’s now normal but only because I edited the css codes, and about the registration the up bar still doesn’t appear so I added a widget to solve this problem, but it doesn’t look good though.

    #192794
    Robin W
    Moderator

    I hadn’t seen that plugin before – looks useful.

    Pippin is a very experienced plugin writer (better than me!), and I just loaded and tested that plugin and it works error free and fine.

    A quick look at the code shows no obvious issues with current versions of wordpress or bbpress.

    It is always a problem for plugin writers to maintain their plugins – I have over 6, and whenever wordpress updates, I have 6 to test and update.

    I don’t really want to take on anymore, else I’d offer to take that one over.

    I’d suggest you use it – worst case at some future stage you may have to stop using it, but as I know of no other plugin that does this, you’ll be no worse off than you are now.

    If it does stop working come back, and I’ll look to see how easy it is to fix, but offhand I see no reason why it will become out of date unless wordpress does some very major changes.

    #192789
    ams047
    Participant

    I am still fairly new and finding my way around, but found your fix gets rid of the error.

    However, the comments in this thread suggested that the reply comments box appears below the comment which is being replied to, which your code does not. Instead the comment box appears at the end of the thread.

    Restoring I() in reply.js to “return document.getElementById(e);” (from “tinymce.execCommand(‘mceFocus’,false,’bbp_reply_content’);”) fixes that. I tried tinymce.execCommand(‘mceFocus’,false,e); which seemed to be more appropriate but that did not work either.

    #192737
    mockendo
    Participant

    Hi,

    I’d like to remove the header from all bbPress pages on my site, but can’t quite figure it out!

    I’m using the theme Total, and advice from the theme creator was to put .ht-main-header{display:none;} in Appearance > Customise > Additional CSS. This worked, but removed the header from all pages across the website and forum. I’d like to keep the header on all main website pages and only remove it from bbPress pages.

    The main forum is here: https://economy10.com/f/

    I can remove the header from an individual page by adding .postid-994 .ht-main-header{display:none;} but this is only for a specific page. How can I do this for all forum pages?

    I’m relatively new to using wordpress/bbpress (and don’t really understand CSS tbh!) so any advice would be greatly appreciated.

    Cheers
    Mark

    #192346
    Robin W
    Moderator

    Untested, but try

    function rew_no_reply_per_forum ($reply_address) {
    	$forum_id = bbp_get_forum_id() ;
    	if $forum_id = 6 $reply_address =  'xxx@yyy.com' ;
    	if $forum_id = 7 $reply_address =  'abd@hdhd.com' ;
    	return $reply_address ;
    }
    
    add_filter ('bbp_get_do_not_reply_address', 'rew_no_reply_per_forum') ;
    #192330

    In reply to: Forum/Topics Order

    Robin W
    Moderator

    it is ‘simply’ ‘showing the forums and sub forums’ – if you want it to show topics as well, then you would use a page with a list of shortcodes eg [bbp-single-forum id=$forum_id]

    This will show all the topics – you would need to do some coding to just show topic titles.

    Codex

    #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

    #191810
    kdelsimone
    Participant

    @jrevillini So here’s something curious: I dropped the code into a bp-custom.php file and it works great. However now users can’t edit their posts. When they click EDIT on a post, they’re simply redirected back to the post and not the /edit page. When I remove the code, the redirect to the /edit page works. Have you observed the same?

Viewing 25 results - 4,326 through 4,350 (of 32,518 total)
Skip to toolbar