Forums Forums Search & Filter Pro Help with automating rebuild Cache

Tagged: 

Viewing 7 posts - 1 through 7 (of 7 total)
  • Anonymous
    #48516

    Hello, great plugin so far..

    I’m using it in conjunction with a wp-broadbean plugin – https://github.com/highrisedigital/wpbroadbean
    to search and filter jobs posted via xml from Broadbean to a posting url at my site.

    The plugin takes the xml and creates a custom post type + adds any taxonomy terms that came with the xml.

    The problem is I’ve noticed newly posted jobs do not appear in my SFPro results – despite having published status and appearing in the wp-admin post list and showing in the themes standard archive and taxonomy templates.

    I can make the jobs appear in the S&F pro results but I have to manually rebuild the SFP cache
    every time after a job has been posted via xml. Since I wont know when the xml is fired this is obviously not practical

    Can someone help with a way to automate this?
    Many thanks

    Trevor
    #48522

    You would have to add some code to the plugin you are using to cache the new post as it is created:

    http://www.designsandcode.com/documentation/search-filter-pro/action-filter-reference/

    Usage

    do_action('search_filter_update_post_cache', 23);
    

    Takes 1 parameters – Post ID

    This allows you to manually update the cache for a particular post – replace 23 with the ID of your post.

    Anonymous
    #48550

    Thanks for that Speedy response Trevor – much appreciated.

    In the inbox.php file of wp-broadbean plugin would line 223 be a suitable place?

    https://github.com/highrisedigital/wpbroadbean/blob/master/inbox.php

    then should i paste the update cache code after line 223 like this:
    ..
    line 223 do_action( ‘wpbb_job_added’, $wpbb_job_post_id, $wpbb_xml_params );
    do_action(‘search_filter_update_post_cache’, $wpbb_job_post_id);
    ..

    Please excuse my ignorance & many thanks for your help

    Trevor
    #48552

    It could well be, try it and see. If not, you would need to talk to that plugin’s author and ask for guidance.

    Anonymous
    #48553

    Did a quick test and it works!
    thanks for the guidance 🙂

    Trevor
    #48559

    I can close this thread and mark it resolved?

    Anonymous
    #48560

    By all means

    thanks

Viewing 7 posts - 1 through 7 (of 7 total)