Compare post levels and user levels wishlist member
I'm using Wishlist Member plugin and I'm building a function which compares user_levels and post_levels, but I can't get my function to work:
check_user_access($userid, $postid){
// get user_levels
$user_levels = WLMAPI::GetUserLevels($userid);
// get the post levels
$post_levels = WLMAPI::GetPostLevels($postid);
// Compare user_levels with post_level
$result = array_search($user_levels, $post_levels);
if ($result === false) {
return false;
}
else {
return true;
}
}
Topic plugin-members membership functions Wordpress
Category Web