How to filter post select field by metabox custom field?

Support MB Builder How to filter post select field by metabox custom field?Resolved

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #18377
    RickRick
    Participant

    I have 3 post types Book, Author, Character.

    I have characters that have a value "author" which is tied to an author post.

    Then I have a book post type, which is tied to an author through a post field. It also has a character field which is a post select field as well. I would like to limit that character dropdown showing on the books page to only those characters that are assigned to the same author as the current book. Is that possible? I tried everything possible I could think of in the Query values in the advanced tab, but couldn't get anything to filter it.

    Any help would be very appreciated.

    Thanks!
    Rick

    #18400
    Anh TranAnh Tran
    Keymaster

    Hi Rick,

    I think that can be done with some code. MB Builder couldn't help building complex queries.

    This is a pseudo code that can help you to start with:

    https://pastebin.com/hVnePVdN

    You might need to change the query to get the proper characters for you.

    #18405
    RickRick
    Participant

    Thanks Anh, I'll give it a shot.

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