MB Relationships - Connection Metadata?

Support MB Relationships MB Relationships - Connection Metadata?

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #8275
    lobstervinelobstervine
    Participant

    Very excited to see the new MB Relationships extension! With MB Relationships, is it possible to also store *connection* metadata? See https://github.com/scribu/wp-posts-to-posts/wiki/Connection-metadata . Thanks!

    #8277
    Anh TranAnh Tran
    Keymaster

    Hi, it’s the next step. The first version hasn’t supported metadata for connections yet. We’ll work on that a little bit later.

    #8309
    lobstervinelobstervine
    Participant

    Thank you! I have installed MB Relationships but am having trouble with the very first step. When I add the code to create a relationship (pasted below) to my functions file, it breaks the site. Am I missing something? I notice it says "Note: you need to hook to mb_relationships_init to make sure the API is ready for use." -- is that a separate step and if so do you have documentation for that piece?

    add_action( 'mb_relationships_init', 'prefix_register_relationships' );
    function prefix_register_relationships() {
        MB_Relationships_API::register( array(
            'id'   => 'posts_to_pages',
            'from' => 'post',
            'to'   => 'page',
        ) );
    } );
    #8339
    jo.onjo.on
    Participant

    That is correct. There still are some errors in the documentation for this extension. In the code you added, remove the very last two characters: ");" They are not supposed to be there.

    #8345
    Anh TranAnh Tran
    Keymaster

    Oh, sorry. jo.on is right. There's a syntax error in the code. Please just remove the last ");". I supposed to write code for PHP 5.3, but then changed to the normal syntax (and forget to remove the last ");").

    #8360
    lobstervinelobstervine
    Participant

    Thank you both! Silly me, I should have been able to figure that one out. I have it working now.

    Another question for you: I read in the documentation (and see by using the plugin) that on the "to" post/page, you can view the connected posts only and can’t edit them. For my project, this is quite limiting. (With posts2posts, you can edit connected posts/pages from both the "from" and "to" post/page edit screens.) Is it possible to enable editing from the "to" post/page with MB Relationships?

    #8367
    Anh TranAnh Tran
    Keymaster

    It should be able. I've just received the bug report and will work on that now.

    PS: I'm done. Will update the extension tomorrow.

    #8370
    lobstervinelobstervine
    Participant

    Great! Thanks, will look for update & try it out tomorrow.

    #18346
    rfrosrfros
    Participant

    Any chance there has been progress on this?

    As a workaround, I am trying to programmatically add custom meta box fields based on relationship settings. This works OK-ish via adding a filter to rwmb_meta_boxes and sniffing out the currently-edited post type/id, but my logic falls apart when trying to pull other custom mb-defined metadata applied to those related posts.

    #18355
    Anh TranAnh Tran
    Keymaster

    Hi rfors,

    Thanks for your message. Unfortunately, we haven't finished this feature yet. We'll let you know when it's done.

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