Skip to:
Content
Pages
Categories
Search
Top
Bottom

bbp_add_caps function ?


  • fatpat76
    Participant

    @fatpat76

    Hello there, I just went through some problems where the bbPress capabilities were not registered in the wp_user_roles option_name row entry. I don’t know what caused it but I was trying to see if I uninstalled/reinstalled bbPress it might reset the capabilities. It didn’t.

    So I got hunting through the code and I found this function:

    /**
     * Adds capabilities to WordPress user roles.
     *
     * @since bbPress (r2608)
     */
    function bbp_add_caps() {
    
    	// Loop through available roles and add caps
    	foreach ( bbp_get_wp_roles()->role_objects as $role ) {
    		foreach ( bbp_get_caps_for_role( $role->name ) as $cap => $value ) {
    			$role->add_cap( $cap, $value );
    		}
    	}
    
    	do_action( 'bbp_add_caps' );
    }

    But nothing seem to ever call this function. I did a search through all of the plugin code and there aren’t any references to this function. What gives?

    In the end I was able to force the capabilities to be rebuilt by adding this function call inside another function that I knew was being called and it worked (I’ve since removed this).

    BTW, this is on WP 3.7.1, bbPress 2.4.1.

    Thanks!
    Patrick

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