# WP and Discourse not in sync using SSO

**URL:** <https://meta.discourse.org/t/wp-and-discourse-not-in-sync-using-sso/47564>\
**Category:** WordPress\
**Created:** [20. Juli 2016 um 20:09 UTC](https://meta.discourse.org/t/wp-and-discourse-not-in-sync-using-sso/47564 "2016-07-20T20:09:13Z")\
**Posts on this page:** 1\
**Showing post:** 16

<div class="post-metadata">

**Author:** ![bynicolas](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bynicolas/32/121170_2.png) [@bynicolas](https://meta.discourse.org/u/bynicolas)\
**Post date:** [9. März 2017 um 21:57 UTC](https://meta.discourse.org/t/wp-and-discourse-not-in-sync-using-sso/47564/16 "2017-03-09T21:57:23Z")

</div>

Excellent, I’ll start working on that… Thanks for your time

**Edit**

I thought I’d share this, it saved me a ton of time.

I managed to show one menu item containing the [discourse SSO](https://meta.discourse.org/t/13045?silent=true) handler link to logged in users and another menu item containing the direct link for visitors by using the [If Menu](https://wordpress.org/plugins/if-menu/) plugin.

It seems to work pretty well, I just needed to add a custom condition using the available filter.

here’s the new custom condition snippet

```
// Modify the If Menu plugin by adding conditions
add_filter( 'if_menu_conditions', 'spb_add_if_menu_conditions' );
function spb_add_if_menu_conditions( $conditions ) {
  $conditions[] = [
    'name' => 'User is not logged in',
    'condition' => function() {
      if( !is_user_logged_in() ) return true;
     },
    'group' => 'User state & roles',
  ];

  return $conditions;

}

```

Simple and neat!

---

_[View the full topic](https://meta.discourse.org/t/wp-and-discourse-not-in-sync-using-sso/47564)._
