WordPress.org

Support

Support » Plugins and Hacks » [Resolved] [Plugin: Flexo Archives Widget] default sql query filters

[Resolved] [Plugin: Flexo Archives Widget] default sql query filters

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Heath Harrelson

    @heathharrelson

    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.

    cheers,
    Christian

    Plugin Author Heath Harrelson

    @heathharrelson

    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.

    sure. try to build your query string similar as in the default widget (see wp-includes/general-template.php, function wp_get_archives() ).

    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?

    cheers,
    Christian

    Plugin Author Heath Harrelson

    @heathharrelson

    I see now. I’ll work up a fix tonight and include it in the next release.

    Thanks for your help.

    Plugin Author Heath Harrelson

    @heathharrelson

    I have added these filters in version 2.1.0.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Resolved] [Plugin: Flexo Archives Widget] default sql query filters’ is closed to new replies.