add_filter and remove_filter added before and after wp_query
This was done to restrict the effect of those filters to this one query between both calls. There are probably other instances of WP_Query during page load, and you don’t want to change their results. Imagine what happens when you do not remove the filter: All later new WP_Query(); calls would be restricted to a … Read more