Have you ever wanted to display different content based on Wishlist Member levels in WordPress? I did. After starting development on a recent project using WLM, I had a hard time finding documentation for specific hooks or functions. I even tried contacting the dev team, but never received a reply… and their documentation is pretty much non-existent. Basically if you are wanting anything other than out-the-box functionality it’s like pulling teeth as you won’t find much out there.
Anyway, if you are running a membership site via WLM and are looking to offer your content in a drip feed on the same page, and not just on a page by page basis, here’s what you can do:
<?php
// Get the current user level from WP
$user = wp_get_current_user();
// Get user levels from WishlistMembers
$levels = WLMAPI::GetUserLevels($user->ID);
// Then run the check for the level you want like this:
if(in_array('silver', $levels)){
// Display silver level content here
}
elseif (in_array('gold', $levels)){
// Display gold level content here
}
?>