Forums Forums Search & Filter Pro Deleted post are still in dropdown field

Tagged: 

Viewing 6 posts - 1 through 6 (of 6 total)
  • Anonymous
    #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

    Trevor
    #151893

    When you delete a post in the normal WordPress way, WordPress would normally trigger our cache system to recognize the change and update the cache. There is an action/hook into that:

    https://www.designsandcode.com/documentation/search-filter-pro/action-filter-reference/#Update_Cache_for_a_Particular_Post

    Anonymous
    #152372

    Thank 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

    Trevor
    #152374
    This reply has been marked as private.
    Anonymous
    #152378

    Thanks 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

    Trevor
    #152380
    This reply has been marked as private.
Viewing 6 posts - 1 through 6 (of 6 total)