guideplugin/result/query_args

Definition

With this filter you can change the WP_Query args for a guide.

Parameters

appy_filters('guideplugin/result/query_args', $args, $guide_id);
  • $args (array) WP_Query args.
  • $guide_id (int) The ID of the guide.

Important note

This filter should be used with care. You change not only the final result but also all partial results of each filter in the guide.

The following query attributes cannot be changed with this filter:

  • fields
  • posts_per_page
  • suppress_filters

Example

The example shows you how to customize the WP_Query args for a certain guide.

<?php 
function my_guide_result_query_args($args, $guide_id) { 

     // The guide result you want to modify 
    if ($guide_id == 24) {
        $args['post_type'] = 'any';
    } 
    return $args;
}
add_filter('guideplugin/result/query_args', 'my_guide_result_query_args', 10, 2);