Forums › Forums › Search & Filter Pro › Post in Search page
- This topic has 24 replies, 2 voices, and was last updated 4 years, 8 months ago by Trevor.
-
Anonymous(Private) February 17, 2020 at 9:53 am #234025
Hello Pauline,
Thank you for your patience.
Here is the example of using the action:
add_action('multilingualpress.metabox_after_update_remote_post', 'mlpress_post_saved',10,2}; function mlpress_post_saved($relationshipContext, $postID ){ //here you can do your staff // you have $post array // you have $relationshipContext with the posts connected to each other // the action can be found in src/multilingualpress/TranslationUi/Post/MetaboxAction.php };
Hope this will help you to achieve what you want.
Best regards,
NarekTrevor(Private) February 17, 2020 at 10:04 am #234027So, 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?
Anonymous(Private) February 18, 2020 at 2:44 pm #234233Hello Pauline,
Thank you for contacting us.
In my previous reply I described in details how to use the filter ;
add_action(‘multilingualpress.metabox_after_update_remote_post’, function($relationshipContext,$post ){
//here you can do your staff
// you have $post array
// you have $relationshipContext with the posts connected to each other
// the action can be found in src/multilingualpress/TranslationUi/Post/MetaboxAction.php
},10,2);
they don’t have the $id for the second parameter, they have entire $post array, so the $id they can get from that array.best regards,
Narek -
AuthorPosts