Skip to:
Content

bbPress.org

Changeset 4304


Ignore:
Timestamp:
11/02/2012 07:30:00 PM (12 years ago)
Author:
johnjamesjacoby
Message:

Capabilities:

  • Filter out bbPress roles from editable_roles array.
  • Introduce bbp_filter_blog_editable_roles() and hook to 'editable_roles'.
  • See #1939.
Location:
trunk/includes/core
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/includes/core/capabilities.php

    r4293 r4304  
    662662
    663663/**
     664 * Removes the bbPress roles from the editable roles array
     665 *
     666 * @since bbPress (r4303)
     667 *
     668 * @param array $all_roles All registered roles
     669 * @return array
     670 */
     671function bbp_filter_blog_editable_roles( $all_roles = array() ) {
     672    return array_diff_assoc( $all_roles, bbp_get_editable_roles() );
     673}
     674
     675/**
    664676 * The keymaster role for bbPress users
    665677 *
  • trunk/includes/core/filters.php

    r4284 r4304  
    5757// Add post_parent__in to posts_where
    5858add_filter( 'posts_where', 'bbp_query_post_parent__in', 10, 2 );
     59
     60// Remove forums roles from list of all roles
     61add_filter( 'editable_roles', 'bbp_filter_blog_editable_roles' );
    5962
    6063/**
Note: See TracChangeset for help on using the changeset viewer.