Support » Plugin: MultilingualPress » Meta box translation

  • Resolved fjobeir

    (@fjobeir)


    Hello
    I have added metabox to posts/pages it is a checkbox to determine whether this post is featured or not. Its value is Yes or null.
    When I mark a post/page as featured, the same post featured value of other languages begin converted to null.

    How can I add metabox that work on all versions?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter fjobeir

    (@fjobeir)

    to be more clear, the reason is that post ID is not the same in all network sites ….. I am featuring post based on its ID, so maybe we should define a base language and find the related IDs of other posts.

    Plugin Author Frank Bueltge

    (@bueltge)

    Thats right. Each post in different languages are different sites of the Multisite. It is right that you get different IDs of a post. But you should have a function to get the ID of each post. Also MLP API give you functions to get the relationship, the IDs of other posts to get his meta data. I think you need this mlp_get_linked_elements( $post_id ). See the documentation – https://github.com/inpsyde/multilingual-press/wiki/Public-Functions#get-the-element-id-in-other-blogs-for-the-selected-element

    But, the meta data was not automatically synchronized from post to post, only the default WP data.

    Plugin Contributor Thorsten Frommen

    (@tfrommen)

    Hi there.

    Sorry, but I don’t understand completely.

    I believe, however, that your save routine does not take the current site into account.

    In your code, there should be a function hooked to save_post (or maybe wp_insert_post).
    Inside that function, add the following as very first thing after the opening curly brace:

    if ( is_multisite() & ms_is_switched() ) {
        return;
    }

    This should help.

    If not, report back, with little more information, please.

    Thanks,
    Thorsten

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Meta box translation’ is closed to new replies.