-
AuthorSearch Results
-
April 2, 2020 at 2:15 pm #238754
In reply to: Cache Building
TrevorParticipantI am not sure what you mean. Our cache will build automatically. It rebuilds when you save a form and the source data has changed, and isn’t already in the cache. This would normally happen in the background, but some servers are not configured to allow background building of the cache, so in those cases the form has to stay open whilst it builds. a message would appear to tell you this.
Every time a post is saved in the normal way (in the WordPress editor), WordPress triggers and action that our plugin uses to update the cache for just that post, so that too is automatic.
The only time it would not be automatic is if you saved a post or changes to a post in a different way. For example, using an import plugin, and sometimes if posts are made with custom front end data entry forms. We have this action (that has to be run after each post is saved by the import plugin):
For example, for WP All Import, in your (child) theme functions.php file you would use this code:
add_action('pmxi_saved_post', 'wp_all_import_post_saved', 1000, 1); function wp_all_import_post_saved($id) { do_action('search_filter_update_post_cache', $id); }
March 12, 2020 at 10:36 am #236441Topic: WP All Import cache
in forum Search & Filter Pro
AnonymousInactiveHi,
I’m having the same problem as mentioned in this thread: https://support.searchandfilter.com/forums/topic/not-showing-all-results-2/
This is in my functions.php file:
add_action('pmxi_saved_post', 'wp_all_import_post_saved', 1000, 1); function wp_all_import_post_saved($id) { do_action('search_filter_update_post_cache', $id); }
But unfortunately this does not help. Is there anything else I can try?
Thanks!
March 11, 2020 at 3:33 pm #236300In reply to: Not showing all results
TrevorParticipant@Oris
You might need to renew your licence to get v2.5.0.
This code in functions has been changed a little to make it trigger much later:
add_action('pmxi_saved_post', 'wp_all_import_post_saved', 1000, 1); function wp_all_import_post_saved($id) { do_action('search_filter_update_post_cache', $id); }
(1000 instead of 10)
@Melvin. You would need to renew your licence and then update the plugin to 2.5.0 and start a new thread, as this thread has private posts that I cannot show you.
March 10, 2020 at 9:34 am #236060In reply to: Index individual post
TrevorParticipantWhen our plugin uses Relevanssi, it only does so when there is a text search, so, yes, if a post is missing from the Relevanssi index and you do a search that includes a text search, it will be missing from the results.
If you are importing posts using WP All Import, for example, both our cache and the Relevanssi index would need updating, with code in the child theme functions.php file:
add_action('pmxi_saved_post', 'wp_all_import_post_saved', 1000, 1); function wp_all_import_post_saved($id) { do_action('search_filter_update_post_cache', $id); relevanssi_index_doc($id, true, relevanssi_get_custom_fields(), true); }
March 9, 2020 at 5:52 pm #235993
TrevorParticipantYou should be able to use a filter in WP All Import to do this.
Add something like this in the child theme functions.php file:
add_action('pmxi_saved_post', 'wp_all_import_post_saved', 1000, 1); function wp_all_import_post_saved($id) { do_action('search_filter_update_post_cache', $id); }
Do a test import of a post and see if it has been added to the cache.
February 20, 2020 at 2:56 pm #234484In reply to: Post in Search page
AnonymousInactiveThank you for the advice. I created the themify-shoppe-child folder with style.css and functions.php files.
The content of functions.php is: (and looks like it’s working!). Thanks.<?php /** ** activation theme **/ add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' ); function theme_enqueue_styles() { wp_enqueue_style( 'parent-style', get_template_directory_uri() . 'https://cdn2.wpformation.com/style.css' ); } add_action('multilingualpress.metabox_after_update_remote_post', 'mlpress_post_saved', 10, 2); function mlpress_post_saved($relationshipContext, $post) { $post_ID = $post->ID; do_action('search_filter_update_post_cache', $post_ID); }
February 18, 2020 at 3:07 pm #234239In reply to: Post in Search page
AnonymousInactiveFor the moment it seems that it works even if I didn’t add this code. Do I let like it is or do I have to change something? Because I don’t think that a use a child theme. Thanks
add_action(‘multilingualpress.metabox_after_update_remote_post’, ‘mlpress_post_saved’, 10, 2);
function mlpress_post_saved($relationshipContext, $post) {
$post_ID = $post->ID;
do_action(‘search_filter_update_post_cache’, $post_ID);February 18, 2020 at 2:57 pm #234237In reply to: Post in Search page
TrevorParticipantAh, I think I see. He is saying that $post is the entire post array of data, so …
add_action('multilingualpress.metabox_after_update_remote_post', 'mlpress_post_saved', 10, 2); function mlpress_post_saved($relationshipContext, $post) { $post_ID = $post->ID; do_action('search_filter_update_post_cache', $post_ID); }
So, that, from what they say, should work.
You should be using a child theme, and place that code at the end (on a new line) of the functions.php file you would find i the child theme folder.
Then test it by importing a post and see if it appeared in the search results.
February 17, 2020 at 10:04 am #234027In reply to: Post in Search page
TrevorParticipantSo, what I gave you changes (very slightly) to this, maybe:
add_action('multilingualpress.metabox_after_update_remote_post', 'mlpress_post_saved', 10, 2); function mlpress_post_saved($relationshipContext, $id) { do_action('search_filter_update_post_cache', $id); }
But, I have no idea how that
$relationshipContext
is used.Can you show me what is in that file:
src/multilingualpress/TranslationUi/Post/MetaboxAction.php
Maybe upload that file to a file sharing site and share the link with me?
February 14, 2020 at 3:05 pm #233980In reply to: Post in Search page
TrevorParticipantAre they able to give an example usage? My first thought would be something like this in the child theme functions.php file:
add_action('multilingualpress.metabox_after_update_remote_post', 'mlpress_post_saved', 1000, 1); function mlpress_post_saved($id) { do_action('search_filter_update_post_cache', $id); }
But only they can confirm precise usage. I cannot find any reference on Google.
-
AuthorSearch Results
-
Search Results
-
Topic: WP All Import cache
Hi,
I’m having the same problem as mentioned in this thread: https://support.searchandfilter.com/forums/topic/not-showing-all-results-2/
This is in my functions.php file:
add_action('pmxi_saved_post', 'wp_all_import_post_saved', 1000, 1); function wp_all_import_post_saved($id) { do_action('search_filter_update_post_cache', $id); }
But unfortunately this does not help. Is there anything else I can try?
Thanks!