Forums › Forums › Search & Filter Pro › Deleted post are still in dropdown field
Tagged: delete cache
- This topic has 5 replies, 2 voices, and was last updated 8 years, 2 months ago by
Trevor.
-
Anonymous(Private) January 10, 2018 at 10:33 pm #151793
Hi,
I haven’t found my answer in this forum, so i post a new topic.
When i delete a post (trash then really delete) the post is still in the drop down of my search and filter on my page on the site. I have to go in admin and click on “rebluid cache”.
However i want to rebuild the cache automaticaly. I wrote a hook :
function auto_rebuild_cache(){
$sf_cache = new Search_Filter_Post_Cache();
$sf_cache->cache_restart();
}
add_action( ‘delete_post’, ‘auto_rebuild_cache’ );But when i delete a post, a get a white page with the status of the cache restarting
How could i solve this problem please ?
Regards
Anonymous(Private) January 13, 2018 at 4:23 pm #152372Thank you for your answer but the normal way for deleting a post with wordpress in the back office (delete then confirm delete in trash) doesn’t trigger the cache update.
I can’t trigger the action you mentioned because the function need a post id and with the delete_post hook you can’t pass the post id because the post is just deleted and don’t exist anymore.
Do you see hat i mean ?
I hope you will have a clue because i really need this plugin in several web site.
Thanks
Anonymous(Private) January 13, 2018 at 5:04 pm #152378Thanks again
I see the one with no thumbnail. What is the conclusion ?
I don’t have the auto count on, it’s disabled
This is my site : http://meilleurcoachimmo.mediacraft.pro/ventes-encheres-privees/
On the first select (“Secteur”), the first option is “a”. It’s an ACF field. However i just deleted the post which have the acf field city with the value “a”…
I have a cache system (wprocket) but i already tested i when it was disabled.
Regards
-
AuthorPosts