MB Relationships - Connection Metadata?
Support › MB Relationships › MB Relationships - Connection Metadata?
- This topic has 9 replies, 4 voices, and was last updated 5 years, 2 months ago by
Anh Tran.
-
AuthorPosts
-
January 21, 2018 at 6:45 AM #8275
lobstervine
ParticipantVery 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!
January 21, 2018 at 11:34 AM #8277Anh Tran
KeymasterHi, it’s the next step. The first version hasn’t supported metadata for connections yet. We’ll work on that a little bit later.
January 24, 2018 at 12:45 AM #8309lobstervine
ParticipantThank 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', ) ); } );
January 26, 2018 at 12:44 AM #8339jo.on
ParticipantThat 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.
January 26, 2018 at 9:35 AM #8345Anh Tran
KeymasterOh, 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 ");").
January 27, 2018 at 12:39 AM #8360lobstervine
ParticipantThank 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?
January 28, 2018 at 3:18 PM #8367Anh Tran
KeymasterIt 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.
January 29, 2018 at 1:01 AM #8370lobstervine
ParticipantGreat! Thanks, will look for update & try it out tomorrow.
February 19, 2020 at 9:34 PM #18346rfros
ParticipantAny 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.
February 20, 2020 at 4:00 PM #18355Anh Tran
KeymasterHi rfors,
Thanks for your message. Unfortunately, we haven't finished this feature yet. We'll let you know when it's done.
-
AuthorPosts
- You must be logged in to reply to this topic.