title: WP add_filter within class constructor does not work
body: <p>I'm using a basic PHP class to add callbacks to existing WC filters, outside the class the callbacks work as they should, but it seems the filters in the constructor do not call the functions, I tried many variations, but none of them work. This is the class:</p>
  <pre><code>class Filters implements FiltersInterface{
      public function __construct()
      {
          add_filter(&quot;woocommerce_rest_product_object_query&quot;, array($this,'FilterByMeta'),           10,2);
          add_filter(&quot;woocommerce_rest_query_var-tax_query&quot;,  array($this,'FilterByTaxonomies'),     10,1);
      }
  
      public function FilterByMeta($args,$request){
          $key = $request-&gt;get_param('meta-key');
          if($key!='' &amp;&amp; $key!=null)
           {
             $args['meta_key'] = $key;
           }  
           $value = $request-&gt;get_param('meta-value');
           if($value!='' &amp;&amp; $value!=null)
            {
              $args['meta_value'] = $value;
            }  
         return $args;
      }
  
      public function FilterByTaxonomies($args){
          var_dump('--');
  
          $attr_term = $_GET['attribute-term'];
          $attr_name = $_GET['attribute-name'];
      
          if($attr_term!='' &amp;&amp; $attr_term!=null &amp;&amp; $attr_name!='' &amp;&amp; $attr_name!=null)
           {
             $args = array(
               array(
                 'taxonomy' =&gt; $attr_name,
                 'field'    =&gt; 'slug',
                 'terms'    =&gt; $attr_term
               )
             );
             return $args;
            }  
            $cat= $_GET['category'];
            if($cat!='' &amp;&amp; $cat!=null)
             {
               $args =  array(
                'relation'            =&gt; 'OR',
                array( 
                  'taxonomy'          =&gt; 'product_cat',
                  'field'             =&gt; 'slug',
                  'terms'             =&gt; $cat
                )
              );  
               return $args;     
              }   
           return $args;
      }
   }
  </code></pre>
  <p>And this is in the index.php file i have in my custom 2-file plugin</p>
  <pre><code>   include('cfilters.php');
  
     $filters = new Filters;
  </code></pre>
  <p>I tried using the class name and '<strong>CLASS</strong> 'in the add_filter, but it didnt work either</p>