Support Forums

Looking for support? You can access the support system via your account.

Forums Forums Search & Filter Pro Post in Search page

Viewing 10 posts - 11 through 20 (of 25 total)
  • Pauline Nava
    #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 Moderator
    #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?

    Pauline Nava
    #234031
    This reply has been marked as private.
    Trevor Moderator
    #234039

    Our email server will probably strip any attachment, sorry.

    Pauline Nava
    #234047
    This reply has been marked as private.
    Trevor Moderator
    #234051
    This reply has been marked as private.
    Pauline Nava
    #234065
    This reply has been marked as private.
    Trevor Moderator
    #234069
    This reply has been marked as private.
    Trevor Moderator
    #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?

    Pauline Nava
    #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)

The topic ‘Post in Search page’ is closed to new replies.