• Resolved Benhalsing

    (@benhalsing)


    Hello,
    this plugin “WP JV Post Reading Groups” affects the search engine, it does not filter with the groups properly crated, it would be good if this could be solved.

    Thank you

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Mikko Saari

    (@msaari)

    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.

    Thread Starter Benhalsing

    (@benhalsing)

    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

    Thread Starter Benhalsing

    (@benhalsing)

    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

    Plugin Author Mikko Saari

    (@msaari)

    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?

    Thread Starter Benhalsing

    (@benhalsing)

    Hi,

    Yes, for now it works perfect!

    Thanks

    • This reply was modified 6 years, 5 months ago by Benhalsing.
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘“WP JV Post Reading Groups” affects the search engine’ is closed to new replies.