Update Parent Meta


Home Forums Front End PM PRO Update Parent Meta

This topic is: Resolved
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #29431
    David
    Participant

    Hi Shamim,
    I am using the following code to add meta to each message. Every time a child message is published I want to update the parent message meta to be the same as the latest child message. This is what I have so far but it is not working. The parent message gets the meta from the first child message. However, it does not update on subsequent messages. Any help is appreciated.

    add_action( ‘fep_action_message_after_send’, function( $message_id, $message, $new_message ){
    if ( ! empty( $message[‘cus_fep_textbox15’] ) ) {
    fep_add_meta( $message_id, ‘cus_fep_textbox15’, $message[‘cus_fep_textbox15’], true );
    fep_add_meta( $new_message->mgs_parent, ‘cus_fep_textbox15’, $message[‘cus_fep_textbox15’], true );
    }
    }, 10, 3);

    #29465
    shamim
    Keymaster

    use fep_update_meta function.

    #29492
    David
    Participant

    Hi,
    Thanks, I cannot make it update the parent message meta. It adds to the reply meta ok but it doesn’t update. The first value goes to the parent but after that it does not update.

    if ( ! empty( $message[‘cus_fep_textbox15’] ) ) {
    fep_add_meta( $message_id, ‘cus_fep_textbox15’, $message[‘cus_fep_textbox15’], true );
    fep_update_meta( $new_message->mgs_parent, ‘cus_fep_textbox15’, $message[‘cus_fep_textbox15’], true );
    }

    Any ideas?

    #29513
    shamim
    Keymaster

    try fep_update_meta( $new_message->mgs_parent, 'cus_fep_textbox15', $message['cus_fep_textbox15'] );

    #29515
    David
    Participant

    Thanks so much!!

Viewing 5 posts - 1 through 5 (of 5 total)

You need to purchase ‘Front End PM PRO’ to create topic in this support forum.

If you already purchased ‘Front End PM PRO’ please LOGIN.