Forums › Forums › Search & Filter Pro › Help with automating rebuild Cache
Tagged: cache
- This topic has 6 replies, 2 voices, and was last updated 8 years, 6 months ago by Anonymous.
-
Anonymous(Private) June 15, 2016 at 9:26 pm #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 practicalCan someone help with a way to automate this?
Many thanksTrevor(Private) June 15, 2016 at 10:24 pm #48522You 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(Private) June 16, 2016 at 6:57 am #48550Thanks 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
-
AuthorPosts