[Plugin: Relevanssi – A Better Search] Relevanssi and Wishlist Member
-
Hi
I have come accress an old post which seems to be still an open issue
https://www.ads-software.com/support/topic/plugin-relevanssi-a-better-search-search-displaying-member-only-pagesI am also using WLM and Relevanssi together and we found the same issue when looking at the search results
I have added the following code to relevanssi_default_post_ok function, the only issue is that in each site you need to write yourself the function UserCanViewPost that determines if the user can view the post or not since WLM does not have this in it’s API
// first check if WLM is activated
$mywlmapi= new WLMAPI();
if ( method_exists($mywlmapi, ‘GetLevels’) ) {// now lets finds out the user levels
$current_user = wp_get_current_user();
$levels = $mywlmapi-> GetUserLevels($current_user->ID);// finds out the post levels
$postlevels = $mywlmapi->GetPostLevels($doc);// now we have two arrays and we need to check if user can view post
if (!UserCanViewPost($postlevels,$levels)) $post_ok = false;
}If more info is need you are welcome to drop me an email
- The topic ‘[Plugin: Relevanssi – A Better Search] Relevanssi and Wishlist Member’ is closed to new replies.