Filter Post Field options by Taxonomy

Support MB Builder Filter Post Field options by Taxonomy

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #43067
    Aaron BAaron B
    Participant

    Good day!

    How can I filter options for the Post Field Type based on Taxonomy?

    Example:

    In my use case I'm creating a website for a chain of hotels, and I'd like to create a dynamic list of last minute vacancies (due to cancellations, etc).

    In total there will be several dozen very similarly named, but very different hotel rooms (with unique photos, floorplans, etc).

    Hotel Room Type CPT | Hotel Name Taxonomy
    This is the core CPT to display room specific information.

    Eg:

    • 2 King Standard | Paradise Beach Hotel
    • 2 King Standard | Mountain Villas Hotel
    • etc...

    Hotel Room Vacancy CPT
    This CPT will use the Post Field Type to allow the end user to select an existing Hotel Room Type CPT and add details about the sale.

    Because there are so many room types with same or similar names, this will be prone to user error unless I'm able to filter the available options in the Post Field of the Hotel Room Vacancy CPT based on the Hotel Name Taxonomy.

    Does MB have this capability?

    #43075
    PeterPeter
    Moderator

    Hello,

    You can use the setting query_args and set the taxonomy argument to filter posts displayed in the list by taxonomy.
    Refer to the documentation
    https://docs.metabox.io/fields/post/
    https://developer.wordpress.org/reference/classes/wp_query/#taxonomy-parameters

    #43081
    Aaron BAaron B
    Participant

    Thank you, Peter! 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.