#1 WordPress forum plugin created by gVectors Team

wpForo – WordPress Forum Plugin
  • Home
  • Forum
  • Migrate to wpForo
  • Addons
  • Addons Demo
  • Documentation

Forum

Home | Forum

wpDiscuz - WordPress Comment Plugin
  • Forums
  • Members
  • Recent Posts
Forums
Main Support Forums
How-to and Troubles...
Admin = Admin roles
 
Share:
Share
Tweet
Share
Notifications
Clear all

[Solved] Admin = Admin roles

    Last Post
RSS

Mistral
Posts: 23
 Mistral
Topic starter
April 12, 2019 11:55 am
(@mistral)
Eminent Member
Joined: 4 years ago

Hi

We are wanting to give forum admins access to parts of the Wordpress admin but not all of it. Right now the requirement to establish if they are admin are quite high. (activate_plugins, install_plugins, create_sites)

Could I request that you add a filter on the function wpforo_current_user_is, which would allow us to determine if they are admin ourselves.

Or is there another method to solve this?

Thanks

Mistral

v

4 Replies
Sofy
Posts: 4057
Sofy - Facebook Sofy - Twitter
 Sofy
Admin
April 12, 2019 1:14 pm
(@sofy)
Support Team
Joined: 4 years ago

Hi Mistral,

I'm going to ask this question to wpForo developers. I'll update this topic asap. 

In case you want to say thank you !)
We'd really appreciate and be thankful if you leave a good review on plugin page. This is the best way to say thank you to this project and support team.

Mistral liked
2 Replies
Mistral
 Mistral
(@mistral)
Joined: 4 years ago

Eminent Member
Posts: 23
June 2, 2019 2:14 pm
Reply toSofySofy

Hi @sofy

Please could I get an update on this thread...

Thanks

v

Sofy
 Sofy
Admin
(@sofy)
Joined: 4 years ago

Support Team
Posts: 4057
Sofy - Facebook Sofy - Twitter
June 3, 2019 12:10 pm
Reply toMistralMistral
Sofy

Hi @mistral,

The hook will be added in the next version release.

Please follow the steps below to get it to work in your case: 

In the functions.php file located in wp-content/plugins/wpforo/wpf-includes/ folder, find the wpforo_current_user_is() function and replace with the following one:

function wpforo_current_user_is( $role ) {
$role = strtolower( $role );

$filter_result = apply_filters('wpforo_current_user_is', NULL, $role);
if( !is_null($filter_result) ) return (bool) $filter_result;

switch ( $role ) {
case 'admin':
if ( current_user_can( 'activate_plugins' ) ) {
return true;
}
if ( current_user_can( 'install_plugins' ) ) {
return true;
}
if ( current_user_can( 'create_sites' ) ) {
return true;
}
break;
case 'moderator':
if ( WPF()->perm->usergroup_can( 'aum' ) ) {
return true;
}
if ( current_user_can( 'moderate_comments' ) ) {
return true;
}
if ( current_user_can( 'edit_published_posts' ) ) {
return true;
}
if ( current_user_can( 'manage_categories' ) ) {
return true;
}
break;
}

return false;
}

As I've already mentioned, the changes will be included in the next version, so you can update the plugin without any worries, the changes will not be lost. 

In case you want to say thank you !)
We'd really appreciate and be thankful if you leave a good review on plugin page. This is the best way to say thank you to this project and support team.

Mistral
Posts: 23
 Mistral
Topic starter
June 3, 2019 2:00 pm
(@mistral)
Eminent Member
Joined: 4 years ago

Thanks @Sofy. This is great.

v

  All forum topics
  Previous Topic
Next Topic  

Forum Search

Join Us!

Download wpForo plugin
on WordPress.org

wpForo Addons

wpforo-private-messages wpforo-advanced-attachments-128x128 wpforo-embeds-128x128 wpForo User Custom Fields addon wpForo – Blog Cross Posting addon wpForo Ads Manager wpForo – WooCommerce Memberships Integration wpForo Emoticons wpForo – Tenor GIFs Integration
View all Addons »

Recent Topics

  • How to make new user to get approve manually before creating post and profile.

    By Adhyansh21, 1 day ago

  • Posts deleted in database still show up on front-end

    By nylex, 1 day ago

  • Not all links are automatically added with the "nofollow" attribute

    By st7878, 1 day ago

  • Editors assign users to groups

    By mike_netinfo, 2 days ago

  • Set password link opens forum login page instead of set password page

    By JanJan, 2 days ago

  • User banned for using icons?

    By JanJan, 2 days ago

Topic Tags

  • css52
  • translation50
  • plugin conflict48
  • seo47
  • new features45
  • buddypress43
  • avatar41
  • moderation40
  • ultimate member40
  • login40
  • forum40
  • registration37
  • threaded layout35
  • cache34
  • spam33
  • editor33
  • menu33
  • shortcode32
  • forum accesses30
  • widget29
View all tags (2192)

Recent Posts

  • RE: User banned for using icons?

    If you have security plugins that can ban users, try de...

    By Chris, 7 hours ago

  • RE: recover deleted forum categories

    @robert @chris could that upgrade message at the top of...

    By dimalifragis, 8 hours ago

  • RE: recover deleted forum categories

    Hi @asmadi1, Contact your hosting to get a backup.

    By Chris, 10 hours ago

  • RE: Posts deleted in database still show up on front-end

    @nylex, Copy the post content or part of it, the go-t...

    By Chris, 12 hours ago

  • RE: Problem with Block themes

    Works very well with those kind of themes. Here is MY...

    By dimalifragis, 12 hours ago

  • RE:

    By Anonymous, 53 years ago

  • RE: Not all links are automatically added with the "nofollow" attribute

    I have no idea, i guess not.

    By dimalifragis, 24 hours ago

Share:
Share
Tweet
Share
  Forum Statistics
21 Forums
9,935 Topics
50.3 K Posts
6 Online
48.2 K Members

Latest Post: User banned for using icons? Our newest member: Find Out About Job Openings Fi... Recent Posts Unread Posts Tags

Forum Icons: Forum contains no unread posts Forum contains unread posts

Topic Icons: Not Replied Replied Active Hot Sticky Unapproved Solved Private Closed

Powered by wpForo | Copyright © 2016-2022 gVectors Team
Copyright Registration Service - Click here for more information or to register work
wpForo is Registered with the IP Rights Office
Copyright Registration Service

Ref: 4477265538
  • Home
  • Forum
  • Migrate to wpForo
  • Addons
  • Addons Demo
  • Documentation