Title: Question about roles
Last modified: August 30, 2016

---

# Question about roles

 *  Resolved [seifen](https://wordpress.org/support/users/seifen/)
 * (@seifen)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/question-about-roles/)
 * Hi Simon,
 * Hope this question is not too unrelated to the plugin:
 * The following code
 *     ```
       $role = get_role( 'editor' );
       $role->add_cap( 'hide_from_intercom' );
       ```
   
 * Is that only applicable to your plugin or does it work if I pasted the snippet
   from Intercom myself?
 * I’m looking for just the very short snippet to exclude Admins and Editors from
   being sent to Intercom!
 * /Seif
 * [https://wordpress.org/plugins/intercom-for-wordpress/](https://wordpress.org/plugins/intercom-for-wordpress/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Simon Blackbourn](https://wordpress.org/support/users/lumpysimon/)
 * (@lumpysimon)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/question-about-roles/#post-6384150)
 * That would only work with my plugin, because the code that checks for the `hide_from_intercom`
   capability is WordPress-specific, it’s not part of Intercom’s snippet code.
 * If you’re pasting the snippet yourself (without the plugin), then you could do
   something like this:
 *     ```
       if ( ! current_user_can( 'edit_others_posts' ) ) {
           // code to display the snippet goes here
       }
       ```
   
 * That checks that the user does not have the `edit_others_posts` capability (which
   is usually only assigned to editors and above) in order to display the snippet.
 * Hope that helps!
    Simon
 *  Thread Starter [seifen](https://wordpress.org/support/users/seifen/)
 * (@seifen)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/question-about-roles/#post-6384156)
 * Wow, you’re a hero! Thank you so much 🙂
 * /Seif
 *  Plugin Author [Simon Blackbourn](https://wordpress.org/support/users/lumpysimon/)
 * (@lumpysimon)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/question-about-roles/#post-6384157)
 * Happy to help 🙂

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Question about roles’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/intercom-for-wordpress_e3f7ff.svg)
 * [Intercom for WordPress](https://wordpress.org/plugins/intercom-for-wordpress/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/intercom-for-wordpress/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/intercom-for-wordpress/)
 * [Active Topics](https://wordpress.org/support/plugin/intercom-for-wordpress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/intercom-for-wordpress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/intercom-for-wordpress/reviews/)

## Tags

 * [role](https://wordpress.org/support/topic-tag/role/)

 * 3 replies
 * 2 participants
 * Last reply from: [Simon Blackbourn](https://wordpress.org/support/users/lumpysimon/)
 * Last activity: [10 years, 9 months ago](https://wordpress.org/support/topic/question-about-roles/#post-6384157)
 * Status: resolved