[Plugin: Flexo Archives Widget] default sql query filters

Hi Heath,
Great plugin, nice work. There are some issues though. I discovered that you don’t allow any sql query filters (‘getarchives_where’ and ‘getarchives_join’) which may break other plugins (in my case it is WPML for multi-lingual support).

To save me from rummaging around in the source code for hours, can you explain why exactly I need to support these things and how not supporting them might break other plugins? I don’t understand how my code could get called from anywhere else within WordPress.

Hi Heath,
Most plugins rely on WordPress’ action hooks and filters in order to extend its features. The default archive widget uses those filters I have mentioned above (it calls ‘apply_filters(‘filter_name’,…)’). As an example, the multi-lingual plugin ‘WPML’ needs those to get posts only of the active language (and not all languages) by joining its own SQL table for the db query.

>> …why exactly I need to support these things…?

You don’t need to. Since you share your code I assume you’d like other people to use it. By writing it in a way to play along with other plugins, more people may use it. I find your plugin great.

I wasn’t trying to be rude above. I want people to be able to use my software, but I only have limited time and knowledge. If you could give me a concrete example of how my plugin interferes with WPML, I would be happy to fix it.

use extra $join and $where variables and use
$join = apply_filters(‘getarchives_join’,…) and
$where = apply_filters(‘getarchives_where’, …) to build them.
Then concatenate them properly before making the sql request.
In this way also other plugins can hook in should be able to play along.
Does this help you?