• Resolved Tim

    (@tjalexander70)


    I was really loving Relevanssi until I realized there was a conflict with WP Job Manager. Is there a snippet for disabling it just for WP Job Manager?

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

    (@msaari)

    I did some testing, and actually I’m not sure if there’s a problem anymore. The WP Job Manager job search seems to work just fine with Relevanssi enabled. Give it a go, and let me know how it works.

    Thread Starter Tim

    (@tjalexander70)

    It was working when I first installed it a few months ago, but at some point, it stopped. Not sure if it was one of your updates or one of there’s, but it is causing a problem and results were not showing doing a keyword search.

    I contacted WP Job Manager after their latest update and initially thought it was a problem with the ZipRecruiter add-on.

    I spent hours turning plugins on and off. The problem did turn out to be Relevanssi. Then I found the online documentation stating there was a conflict. And, I tried another search plugin and the same thing happened.

    Plugin Author Mikko Saari

    (@msaari)

    I don’t know –?I just ran latest Relevanssi and latest WP Job Manager, and the search in WP Job Manager works without problems, thus I can’t reproduce the issue. The WP Job Manager search didn’t seem to trigger the “prevent the default search” functionality in Relevanssi, that’d be one way this could happen. But it doesn’t seem to be the case here.

    So, sorry, but unless I can reproduce the problem somehow, I can’t do anything about it. I can also only look at this from Relevanssi’s side of things; I unfortunately don’t have the time to study how the WP Job Manager search works.

    Plugin Author Mikko Saari

    (@msaari)

    Here’s a quick fix Adam Lenz sent me:

    function relevanssi_fix_for_wp_job_manager( $args ){ 
        remove_filter('posts_request', 'relevanssi_prevent_default_request'); 
        remove_filter('the_posts', 'relevanssi_query'); 
    } 
    
    add_action( 'get_job_listings_init', 'relevanssi_fix_for_wp_job_manager' );

    It’s got something to do with caching there in wp-job-manager-function.php
    between line 156 and 202. I traced the output to there and just applied the remove filter at the first chance before.

    I also looked at the WPQuery object before the query and this stood out

    'request' => 'SELECT * FROM wp_9_posts WHERE 1=2',

    A search for that in my plugins dir pointed me to relevanssi-premium/lib/common.php line 992 and 994. Affecting the variable $prevent might also have a positive outcome.

    Plugin Author Mikko Saari

    (@msaari)

    That’s what relevanssi_prevent_default_request does, but it’s covered by

    remove_filter('posts_request', 'relevanssi_prevent_default_request');

    It’s probably possible to modify the relevanssi_prevent_default_request() function in a way that would make the WP Job Manager search work, but I tried that, and the search didn’t seem to trigger the filter there, I don’t think is_search() was being set to true when I tried. But just disabling the filter does a clean job there.

    Thread Starter Tim

    (@tjalexander70)

    Sorry it took so long to get back. The “quick fix” seems to be working fine. Thank you!!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘WP Job Manager’ is closed to new replies.