Post in Search page

Forums › Forums › Search & Filter Pro › Post in Search page

Viewing 10 posts – 11 through 20 (of 25 total)
  • Anonymous
    #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,
    Narek

    Trevor
    #234027

    So, 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
    #234031
    This reply has been marked as private.
    Trevor
    #234039

    Our email server will probably strip any attachment, sorry.

    Anonymous
    #234047
    This reply has been marked as private.
    Trevor
    #234051
    This reply has been marked as private.
    Anonymous
    #234065
    This reply has been marked as private.
    Trevor
    #234069
    This reply has been marked as private.
    Trevor
    #234163

    The file it was in was MetaboxAction-POST-file.php, but it is not obvious what to use $relationshipContext for. It may not be necessary, I don’t know.

    Show them the code I last gave you and see if they can correct it?

    Anonymous
    #234233

    Hello 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

Viewing 10 posts – 11 through 20 (of 25 total)

Search & Filter Support
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

We also use cookies to store items in your cart as well as allowing your to login on the site.

You can adjust all of your cookie settings by navigating the tabs on the left hand side.

By continuing to use this site, you also agree to our Privacy Policy.