WordPress.org

Support

Support » Plugins and Hacks » How to use set_query_vars

How to use set_query_vars

  • moikirsch

    @moikirsch

    Hi,

    I’m trying to make a plugin that filters posts that appear on 2 categories…

    For testing purposes I did this:

    add_action('parse_request', 'dualcatsfilter' );
    
    function dualcatsfilter( $cat1 = 14, $cat2 = 79 ){
    	global $wp;
    	$wp->set_query_var('category__and', array($cat1, $cat2));
    }

    But it doesn’t work… I’m thinking that maybe I didn’t understand how to use the set_query_var function.

    Can anyone help me around?

    Thanks

  • The topic ‘How to use set_query_vars’ is closed to new replies.
Skip to toolbar