This should be easy to fix. Try adding this to your theme functions.php:
add_filter( 'relevanssi_post_ok', 'rlv_jv_post_ok', 11, 2 );
function rlv_jv_post_ok( $post_ok, $post_id ) {
if ( function_exists( 'wp_jv_prg_user_can_see_a_post' ) ) {
$post_ok = wp_jv_prg_user_can_see_a_post( get_current_user_id, $post_id );
}
return $post_ok;
}
Does that fix the problem? If it works, I can add this to Relevanssi core.
Hello, thanks for answering,
Adds in the function apparently works for post public, but the function of that puglin “WP JV Post Reading Groups” is for private post, does not work for private posts
How should I do to see the private posts?
Thank you
Hello,
Apparently found the problem and it turned out to be “get_current_user_id()” in summary it would be like this,
add_filter( 'relevanssi_post_ok', 'rlv_jv_post_ok', 11, 2 );
function rlv_jv_post_ok( $post_ok, $post_id ) {
if ( function_exists( 'wp_jv_prg_user_can_see_a_post' ) ) {
$post_ok = wp_jv_prg_user_can_see_a_post( get_current_user_id(), $post_id );
}
return $post_ok;
}
I will continue with more tests,
Thanks
Yeah, get_current_user_id()
is a function so it needs the parenthesis. Sorry about that.
Does it work better with the correct function in place?
Hi,
Yes, for now it works perfect!
Thanks
-
This reply was modified 6 years, 5 months ago by Benhalsing.