Info
- 10 posts
- 2 voices
- Started 2 years ago by Marcomail
- Latest reply from Marcomail
- This topic is not resolved
Function to check if a user is in a specific wordpress category
-
- Posted 2 years ago #
Do you know i could check in bbpress if a user is in a specific wordpress user category ? I must create a new user category in wordpress, and i'd use this in bbpress.
for example
if user_id in category=example_category
make this...
else
-
- Posted 2 years ago #
If you have the WP environment loaded, then you can use the regular WP functions. You need to put some more light on the subject so that we can brainstorm. ;)
-
- Posted 2 years ago #
yes, but i'm not using wp-blog-header...i have integrated bbpress in the layout without using the WP environment loaded
sorry but my english is very bad :)
-
- Posted 2 years ago #
I didn't get it. Are you loading bbPress on a WordPress page? In any case, WP functions can be accessed on WP pages. Please elaborate.
-
- Posted 2 years ago #
no, i'm not loading bbpress on a wordpress page...i've created an identical theme for bbpress
-
- Posted 2 years ago #
Then what do ya mean by checking if the user is in a particular WP category? An example would be great! :)
-
- Posted 2 years ago #
user category, for example contributor, administrator, author....bbpress have the corrispective, but i'd create a new user category in wordpress
-
- Posted 2 years ago #
ohk! I got it now. Its called as user role.
So you want to check the user role of WP and then show content based on it or something similar. right? -
- Posted 2 years ago #
You probably need to look into this wordpress file
wp-includes\capabilities.phpand mimic that function in bbPress or alternatively load WP environment and use it. I would recommend avoiding the latter option due to performance issues.Hope that helps! :)
-
- Posted 2 years ago #
thanks, yes, load the environment it's simple, but i'd bbpress quickly
-
You must log in to post.