Support Forum
Support › MB Relationships › MB Relationships - Connection Metadata?
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!
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.
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',
) );
} );
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.
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 ");").
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?
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.
Great! Thanks, will look for update & try it out tomorrow.
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.
Hi rfors,
Thanks for your message. Unfortunately, we haven't finished this feature yet. We'll let you know when it's done.