Added $query to apply_filters() function

Fixes
- PHP Notice:  Undefined variable: query