WordPress.org

Ready to get started?Download WordPress

Forums

Query Multiple Taxonomies
multiple custom post type filter (8 posts)

  1. tiagoalves83
    Member
    Posted 4 years ago #

    Hi Scribu,

    I have the following function:

    function my_qmt_post_type() {
        return 'custom-post-type';
    }
    add_filter('qmt_post_type', 'my_qmt_post_type');

    Can I have my function returning an array of custom post types? It will work with your plugin ?

    When are you releasing the next version ? I am running 1.2 alpha 5

    Thanks...

    http://wordpress.org/extend/plugins/query-multiple-taxonomies/

  2. scribu
    Member
    Plugin Author

    Posted 4 years ago #

    By passing an array, you expect to get a list containing posts with more than one post type?

  3. tiagoalves83
    Member
    Posted 4 years ago #

    Exactly! Is it possible?

    I had an idea. Can you help me with the development?
    It would be very nice, if inside the Drill Down Widget we could select a custom post type (from a list) and one of the taxonomies associate with that custom post type (auto loaded after we select the custom post type) and the widget would search by that custom post type and taxonomy. No more need for the filter function...
    Is it possible to do something like this ?

  4. scribu
    Member
    Plugin Author

    Posted 4 years ago #

    That sounds like a good idea, except a taxonomy can be associated to multiple post types, which opens a whole new can of worms.

  5. scribu
    Member
    Plugin Author

    Posted 4 years ago #

    In the development version, the widget now has a Post Type dropdown, but the query is not restricted to that post type.

    This means that you shouldn't share taxonomies between post types if you want only one post type to be shown.

  6. tiagoalves83
    Member
    Posted 4 years ago #

    Nice!

    You said that "the query is not restricted to that post type. But is the query restricted to any post type? Do I still need the filter function to use custom post type?

    If I share taxonomies to different post types, the plugin will be able to query all post types associated to that taxonomy? (this sounds good ...)

  7. scribu
    Member
    Plugin Author

    Posted 4 years ago #

    You said that "the query is not restricted to that post type. But is the query restricted to any post type?

    It's restricted to public post types - i.e. no revisions etc.

    If I share taxonomies to different post types, the plugin will be able to query all post types associated to that taxonomy? (this sounds good ...)

    Yes: For example, if you have a 'color' taxonomy associated to both 'cars' and 'bicycles' post types, when you go to ?tag=sporty&color=red, you would get any car or bicycle that matches that query.

    PS: This is the default WordPress behaviour when you visit a single taxonomy archive.

  8. scribu
    Member
    Plugin Author

    Posted 4 years ago #

    Do I still need the filter function to use custom post type?

    No, that filter doesn't exist anymore.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic