Forums › Forums › Search & Filter Pro › new posts are not showing in search results
- This topic has 17 replies, 3 voices, and was last updated 8 years, 3 months ago by
Ross.
-
Anonymous(Private) December 5, 2017 at 12:08 pm #145709
Hi, I have a really odd problem with search and filter results.
My site allows users to upload a custom post ‘property’.
When they upload the property, it will not show in the search and filter results. It’s odd as the internal search of the website finds it as soon as it’s published. Logging in as admin shows the property post that they have uploaded as published, it just wont display in search and filter results.
I have noticed also that if I log in as admin and edit their post slightly and update it, shows up on the results, for some reason S&F does not like my users posts.
any help will be great.
Anonymous(Private) December 5, 2017 at 4:33 pm #145818Hi,
I have found the point where the posts are being created, it is done with acf_form (advanced custom fields).
here is the point of creation:
acf_form(array( 'post_id' => 'new_post', 'post_title' => true, 'post_content' => true, 'html_submit_spinner' => '<span class="acf-spinner"></span>', 'fields' => array( 'field_58cbdee51e676', 'field_59275314be48d', 'field_58cbdea81e675', 'field_592761f1f5089', 'field_58cc419adc979', 'field_58cbdf351e677', 'field_58cc4030d72ed' , 'field_58cbe07a1e67f', 'field_58cbe4815ba98', 'field_58cbe4385ba97', 'field_58cbe4255ba96', 'field_5927621af508a', 'field_58f9fb4b79b0f', 'field_5926bf6634841', 'field_5926b208b9016', 'field_58c02d04898e2', 'field_58c02e471efe3', 'field_58c02ec61e011', 'field_592eb6f95b95b' ), 'new_post' => array( 'post_type' => 'property', 'post_status' => 'publish' ), 'return' => home_url('my-account/?profile=all-post'), 'submit_value' => 'Create Property' ));is this where I would add the “do_action(‘search_filter_update_post_cache’, xx);”?
sorry, a little out of my depth here…
thanks!
Trevor(Private) December 5, 2017 at 4:39 pm #145820Ah. ACF. we have done a lot of digging with that before. See this post:
https://support.searchandfilter.com/forums/topic/cache-not-updated-automatically/page/2/#post-94346
Anonymous(Private) December 7, 2017 at 3:33 pm #146253Hi Trevor, thanks for pointing me to here, however the fix did not work. I am not sure if I have missed something though, all I have done here is add
function my_acf_save_post( $post_id ) { // bail early if no ACF data if( empty($_POST['acf']) ) { return; } if ((!is_admin()) || (defined('DOING_AJAX') && DOING_AJAX)) { do_action("search_filter_update_post_cache", $post_id); } } add_action('acf/save_post', 'my_acf_save_post', 20);to my functions file… I have tried to backtrack through this thread to see if something is missing. There are many private messages though so it’s difficult to tell.
-
AuthorPosts