10up/ElasticPress — pull request #178 by adamsilverstein (2014-12-23 14:57:20+00:00)
Title: Add WP_Query integration on init, not plugin load

Switches the integration setup to fire on init, once WordPress is loaded and any potential theme filters have a chance to load. Also, updates the unit test factory setup to use the new setup call. All unit tests pass aftert his change.

Corrects an issue where it was not possible to use the ep_admin_wp_query_integration filter to enable admin side ES enhanced queries during an ajax callback (or possibly at all). Because the ep_admin_wp_query_integration filter was applied during class instantiation (at plugin load), the returned value was always false.Switches the integration setup to fire on init, once WordPress is loaded and any potential theme filters have a chance to load.

Corrects an issue where it was not possible to use the ep_admin_wp_query_integration filter to enable admin side ES enhanced queries during an ajax callback (or possibly at all). Because the ep_admin_wp_query_integration filter was applied during class instantiation (at plugin load), the returned value was always false.