Posted on

Membermouse

If you’re using MemberMouse to manage memberships on your site, having Relevanssi co-operate with MemberMouse is easy using the relevanssi_post_ok filter hook. Just add the following code to your theme functions.php and your protected content will not be displayed to users without access to the content:

add_filter( 'relevanssi_post_ok', 'membermouse_relevanssi_ok', 20, 2 );
function membermouse_relevanssi_ok( $post_ok, $doc ) {
    if ( function_exists( 'mm_access_decision' ) ) {
        $post_ok = mm_access_decision( array( 'id' => $doc, 'access' => 'true' ) );
    }
    return $post_ok;
}

Leave a Reply

Are you a Relevanssi Premium customer looking for support? Please use the Premium support form.

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.