prevent duplicate relationship

Support MB Relationships prevent duplicate relationship

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #49767
    aryanrajaryanraj
    Participant

    Hi, i have a relationship from pictures to books. the relationship is 1:1 Reciprocal relationship. i want to prevent assigning a pictures post (type). to a different book. I basically want to hide the already linked relation post so it not get reassigned to different.

    i see there is Query args, wonder if anyway we can exclude those already have relationship assigned.

    Thanks.

    #49771
    PeterPeter
    Moderator

    Hello,

    Thanks for reaching out.

    There isn't an option to exclude a post from the list if it has a relationship. I will inform the development team to consider supporting this feature in future updates.

    Regarding the reciprocal, it will work if you have the relationship for the same post type. Like from pictures to pictures. Following the documentation https://docs.metabox.io/extensions/mb-relationships/#relationship-settings

    #49822
    aryanrajaryanraj
    Participant

    I have tried few things and i am not able to find the right hook, is there any way to pass a new filter to change the query? currently it list all posts and i wonder if i can overwrite this query. i am looking for the right hook.

    #49825
    PeterPeter
    Moderator

    Hello,

    We are working on this feature, you can check it in the pull request https://github.com/wpmetabox/mb-relationships/pull/94/changes
    If you are familiar with coding, feel free to make the changes on your site to see if it helps.

    #49827
    aryanrajaryanraj
    Participant

    Thanks, i see the pull request is still open for 3 weeks, will it be merged anytime soon?

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