This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Bug – Exclude results

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #31372
    wiredmedia62wiredmedia62
    Participant

    Hi There,

    In Advanced Options – Exclude/Include results, when I search in the Exclude posts/pages/cpt section the results brought back from the wd_search_cpt action are limited to 20 – the limit is hardcoded in /backend/settings/class/wd_cpt_select.class.php line 111 and there isn’t a way to change it. Is there a reason why there is a limit and could this be removed or include a hook to modify?

    Thanks, Paul.

    #31379
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi,

    It is limited intentionally for better server performance and shorter response times on large wp_post tables. 20 seemed to be more than enough for now.

    You can change it via the asp_query_args filter if you need to:

    add_filter("asp_query_args", "asp_query_args_change", 10, 2);
    function asp_query_args_change($args, $search_id) {
      if ( $search_id == -1 )
    	$args['posts_per_page'] = 100;
      return $args;
    }

    The $search_id should be -1 in that context, but you may have to remove that condition it if it does not work.

    #31380
    wiredmedia62wiredmedia62
    Participant

    Great, that all seems to work and thanks for the quick response.

    #31382
    Ernest MarcinkoErnest Marcinko
    Keymaster

    You cannot access this content.

    #31384
    wiredmedia62wiredmedia62
    Participant

    You cannot access this content.

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Bug – Exclude results’ is closed to new replies.