# Integração de Membros do WordPress (Fórum Privado) com Discourse

**URL:** <https://meta.discourse.org/t/wordpress-membership-integration-private-forum-with-discourse/91438>\
**Category:** WordPress\
**Created:** [3 Julho , 2018 03:36 UTC](https://meta.discourse.org/t/wordpress-membership-integration-private-forum-with-discourse/91438 "2018-07-03T03:36:47Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)\
**Post date:** [3 Julho , 2018 19:23 UTC](https://meta.discourse.org/t/wordpress-membership-integration-private-forum-with-discourse/91438/2 "2018-07-03T19:23:15Z")

</div>

> [@JeremyC](#):
>
> I want to know if its possible with the current [WP Discourse](https://github.com/discourse/wp-discourse) plugin to ensure that ONLY paying members are allowed to enter the forum?

Yes, if you use your WordPress site as the SSO provider for your forum, there is an action hook that you can use to limit which users are able to login to the forum. The hook is called `wpdc_sso_provider_before_sso_redirect`. Some code like this, added to a plugin or your theme’s `functions.php` file will work. You will need to figure out how to check the user’s WooMembership level.

```plaintext
add_action( 'wpdc_sso_provider_before_sso_redirect', 'wpdc_custom_check_user_membership', 10, 2 );
function wpdc_custom_check_user_membership( $user_id, $user ) {
    if ( /* Some condition that returns true if the user doesn't meet the membership requirement */ ) {
	    wp_safe_redirect( home_url() );

	    exit;

    }
}

```

---

_[View the full topic](https://meta.discourse.org/t/wordpress-membership-integration-private-forum-with-discourse/91438)._
