Ignore sort apply for certain query on Post Types Order

This replaced the deprecated filter pto/posts_orderby

The free WordPress plugin Post Types Order is already a “must have” code on any website. Control any post sorting through a nice and easy to use interface.

When Autosort is ON, the sorting is applied to all queries that match the post type. It can be forced by either using the ignore_custom_sort argument within the query , or by using a filter pto/posts_orderby/ignore which can be placed within any code, preferable on theme functions.php

Example
The following code ignore the sort apply for any query which include ‘reports’ post type

	add_filter('pto/posts_orderby/ignore', 'theme_pto_posts_orderby', 10, 3);
    function theme_pto_posts_orderby($ignore, $orderBy, $query)
       {
           if( (! is_array($query->query_vars['post_type']) && $query->query_vars['post_type'] == 'reports') || 
                   (is_array($query->query_vars)   &&  in_array('reports', $query->query_vars)))
                   $ignore = TRUE;
           
           
           return $ignore;
       }