WordPress.org

Ready to get started?Download WordPress

Forums

Query Multiple Taxonomies
[resolved] [Plugin: Taxonomy Drill-Down] Making the reset link user-defined (3 posts)

  1. Travis Northcutt
    Member
    Posted 3 years ago #

    Just an idea for an enhancement to this plugin - an option to change the "Reset" link (defined in the get_base function on line 87 of core.php), perhaps on a per-widget basis. If I knew how to add this functionality I'd supply a patch, but I don't.

    My use-case that prompted this thought: using this plugin's widget to allow a user to filter items on an inventory page, and only displaying the widget on pages containing inventory (i.e. not on the home page). Without changing the reset link, the user would be directed back to the home page, which would be confusing. I was able to simply change line 93 to return $base_url . '/inventory';, but obviously that's hacky and not an ideal solution.

    Allowing the user to set the reset link on a per-widget basis would also allow for using multiple instances of the widget on different pages/kinds of pages. Perhaps just a field in the widget (where taxonomies are selected) allowing the user to append something to the URL would suffice?

  2. scribu
    Member
    Plugin Author

    Posted 3 years ago #

    You can change the reset link via a filter:

    http://github.com/scribu/wp-query-multiple-taxonomies/wiki

    There's no per-widget setting, but you could use qmt_get_query() to check which taxonomies are currently queried.

  3. Travis Northcutt
    Member
    Posted 3 years ago #

    Ahh, that's perfect. Didn't realize there was more documentation available somewhere. That'll do nicely, thanks! (I do still think there could be a use for what I was talking about, for non-developers who don't want to add code, but that depends on how much you want to add extra code to the plugin, etc. This is great for me.)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic