WordPress.org

Ready to get started?Download WordPress

Forums

Query Multiple Taxonomies
[resolved] A nice addition (patch) for drilling in subpages (3 posts)

  1. konrad_ha
    Member
    Posted 1 year ago #

    Hi scribu,

    I'm about to start using your plugin for an interesting site, especially the checkbox functionality is great!

    During testing I realized that the plugin would always bump back to the blog's base URL.

    I applied this little patch to QMT_URL::get_base :

    public function get_base() {
    		static $base_url;
    
    		if ( empty( $base_url ) ) {
    
    			$protocol = ( strpos( strtolower($_SERVER['SERVER_PROTOCOL']),'https' ) === FALSE ) ? 'http' : 'https';
    			$base_url = apply_filters( 'qmt_base_url', $protocol . '://' .$_SERVER['HTTP_HOST'] .  parse_url($_SERVER['REQUEST_URI'],PHP_URL_PATH) );
    
    		}
    
    		return trailingslashit( $base_url );
    	}

    What this does is using the current permalink instead of the blog's base URL. Right now everything seems to work just as expected, meaning I can use the checkbox drilling in categories.

    I wonder if I have overlooked something, but this really makes the plugin much more useful to me.

    Feel free to consider adding this to a future release. Right now I am using a fork of your plugin, but I'd love to revert back to the "official" version with all the updates and whatnot.

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

  2. scribu
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Konrad,

    See that apply_filters( 'qmt_base_url', ... ) call?

    You can use that to overwrite the URL that QMT generates, without forking the plugin:

    https://github.com/scribu/wp-query-multiple-taxonomies/wiki/Changing-URLs

  3. konrad_ha
    Member
    Posted 1 year ago #

    I knew I had forgotten something! Thanks and keep up the good work, this is a very well written Plugin.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.