Skip to:
Content
Pages
Categories
Search
Top
Bottom

Function to check if a user is in a specific wordpress category

  • 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

Viewing 9 replies - 1 through 9 (of 9 total)
  • 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. ;)

    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 :)

    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.

    no, i’m not loading bbpress on a wordpress page…i’ve created an identical theme for bbpress

    Then what do ya mean by checking if the user is in a particular WP category? An example would be great! :)

    user category, for example contributor, administrator, author….bbpress have the corrispective, but i’d create a new user category in wordpress

    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?

    You probably need to look into this wordpress file wp-includescapabilities.php and 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! :)

    thanks, yes, load the environment it’s simple, but i’d bbpress quickly

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