Copy some sub fields in group with polylang

Support MB Group Copy some sub fields in group with polylangResolved

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #28132
    Régis EvennouRégis Evennou
    Participant

    Hi,
    I need to copy some sub fields with polylang, not all fields of the group.
    I used to copy needed custom fields with polylang using:

    add_filter( 'pll_copy_post_metas', 'copy_post_metas' );
     
    function copy_post_metas( $metas ) {
        return array_merge( $metas, array( 'my_post_meta' ) );
    }

    But sub fields are not registred as meta_key in wp_postmeta table, they are stored in an array in meta_value.
    Is there a way to do that ?
    Thank you

    #28142
    Long NguyenLong Nguyen
    Moderator

    Hi,

    I think you need to get the group value and all subfields inside, add some fields to an array modify the value. Then update the array to other posts. Refer to this topic https://support.metabox.io/topic/replace-array-value-in-group/

    Hope that helps.

    #28153
    Régis EvennouRégis Evennou
    Participant

    I will try.
    Thank you

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.