Custom Fields
Re-Envisioned
Support MB Relationships How to retrieve connected post on each related post

  • Creator
    Topic
  • #9118
    foundbutlost
    Participant

    Type: Post to page
    *post1,post2,post3,post4 to page1

    is there any API to call all post connected to page1 on each connected post?

    Example: On post2, how do i call the other 3 post: post1,post3,post4.

    do i have to query the “To” ID in Mb_relationship_table first and then using the id in the Wp query to retrieve all the other post?

    Thank you, i tried my best to explain it to you!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Author
    Replies
  • #9127
    Anh Tran
    Keymaster

    Hi,

    I think you’re right. First, get the ID of the connected page1. Then do another query to get all posts that connect to page1.

    #9141
    foundbutlost
    Participant

    You dont think you can make an API for this? i think it will be useful in many cases. thank you

    #9149
    Anh Tran
    Keymaster

    I got it. Let me try that.

    #9251
    Truong Giang
    Participant

    Hi @foundbutlost,

    Assume post2 also connects to page2, do you want to retrieve all posts connect to page1 or page 2?

    #9253
    foundbutlost
    Participant

    Well, in my case that won’t happen. Because it’s a song -> album relationship so one song can only belong to one album.

    #9390
    Truong Giang
    Participant

    Hi there,

    That feature is added in 1.2.0 version. The documentation is here: https://docs.metabox.io/extensions/mb-relationships/#displaying-sibling-items

    Thank you

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How to retrieve connected post on each related post’ is closed to new replies.