# Feature request: IF current\_user\_role

**URL:** <https://forum.pinegrow.com/t/feature-request-if-current-user-role/7031>\
**Category:** WordPress\
**Tags:** feature-request\
**Created:** [September 29, 2022, 12:57pm UTC](https://forum.pinegrow.com/t/feature-request-if-current-user-role/7031 "2022-09-29T12:57:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![adamslowe](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/adamslowe/32/4590_2.png) [@adamslowe](https://forum.pinegrow.com/u/adamslowe)\
**Post date:** [September 29, 2022, 12:57pm UTC](https://forum.pinegrow.com/t/feature-request-if-current-user-role/7031/1 "2022-09-29T12:57:03Z")

</div>

I have a use case where I need to show or hide components based on user role, and I realized that there are no conditionals for that yet. Is there any way you can add a function for that? Ideally, it would pre-define the built-in WP roles and let you type in a custom role if you are using one.

In the meantime, I’ll create a custom capability and use the IF current\_user\_can conditional. But, with the upcoming WP plugin, I suspect a lot of new users won’t have a clue how to do that.

---

<div class="post-metadata">

**Author:** ![Pinegrow\_Learner](https://avatars.discourse-cdn.com/v4/letter/p/df705f/32.png) [@Pinegrow\_Learner](https://forum.pinegrow.com/u/Pinegrow_Learner)\
**Post date:** [October 31, 2022, 8:43am UTC](https://forum.pinegrow.com/t/feature-request-if-current-user-role/7031/2 "2022-10-31T08:43:34Z")

</div>

No doubt! This will speed things up for sites with restricted content based on user role.
