Skip to main contentSkip to footer

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. Add the following code to your site 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;
}

Your account

Not logged in. Log in to see your license details.

Search

Popular Resources

Excluding protected posts

A site I’m working with has a handful of “protected” posts (password required to view). For various reasons, we don’t want to show these in search results. While there is no excerpt shown, I’d prefer for people to not even know they exist. Relevanssi sees protected posts as public posts……2 ); function rlv_search_exclude_protected( $allow, $post_id ) { $post = get_post( $post_id ); if ( ! empty( $post->post_password ) ) { $allow = false; if ( is_user_logged_in() ) { $allow = true; } } return $allow; } Now protected posts are not shown to searchers who are not logged in….

bbPress: Private Groups support
Private Groups is a plugin that makes bbPress forum groups private. Relevanssi, however, doesn’t understand that privacy and will show…

Related Posts:

Comment Section:

Leave a Reply

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

Fill out this field
Fill out this field
Please enter a valid email address.
You need to agree with the terms to proceed