# ניהול חברי קבוצה ב-Discourse באמצעות WP Discourse SSO

**URL:** https://meta.discourse.org/t/manage-group-membership-in-discourse-with-wp-discourse-sso/74724
**Category:** Administrators
**Tags:** groups, wordpress, payments, how-to
**Created:** [24 בנובמבר,‏ 2017,‏ 6:55am UTC](https://meta.discourse.org/t/manage-group-membership-in-discourse-with-wp-discourse-sso/74724 "2017-11-24T06:55:17Z")
**Posts on this page:** 1
**Showing post:** 51

<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: [19 בפברואר,‏ 2019,‏ 9:54pm UTC](https://meta.discourse.org/t/manage-group-membership-in-discourse-with-wp-discourse-sso/74724/51 "2019-02-19T21:54:01Z")

</div>

> [@PatrickH](#):
>
> i can’t figure out what is wrong…

If you are developing this on your local computer, you can create a `debug.log` file in your `wp-content` folder, and add the following to your `wp-config.php` file so that you can write to the file:

```plaintext
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false );

```

I add this function in a plugin to write to the `debug.log` file:

```plaintext
function write_log( ...$log_items ) {
	if ( true === WP_DEBUG ) {
		foreach ( $log_items as $log_item ) {
			if ( is_array( $log_item ) || is_object( $log_item ) ) {
				error_log( print_r( $log_item, true ) );
			} else {
				error_log( $log_item );
			}
		}
	}
}

```

This will let you add calls to `write_log` to your code so that you can see what’s going on. For example, in the `dcpmp_get_level_for_id` function, you can add:

```plaintext
write_log( 'In the dcpmp_get_level_for_id function, called with the id argument set to: ', $id );

```

That will let you know if the function is being called, and what argument is being passed to it. Make sure that `write_log` calls are removed before you add the code to your live site. It is usually possible to work through code in this way, to figure out where it is going wrong.

---

_[View the full topic](https://meta.discourse.org/t/manage-group-membership-in-discourse-with-wp-discourse-sso/74724)._
