Correct way to filter get_pages() function
If you inspect the code for get_pages() you’ll see it calls $wpdb->get_results($query); which in turn calls $this->query( $query ); In there, there’s a filter: $query = apply_filters( ‘query’, $query ); where $query is the full SQL query string, right before it gets executed. Unfortunately, it seems to be the only filter that can do the … Read more