title: Can't get WordPress hook to fire inside embedded class
body: <p>I am trying to build some nice metabox functionality with some oop.</p>
  
  <p>I have my main DazSEO class, which inside contains a Metabox Class.</p>
  
  <p>When I set WordPress save data hooks up inside the metabox class, they won't fire, but when I set them up from the root class, they will.</p>
  
  <p>Is using hooks inside embedded classes incompatible with the WordPress hook system?</p>
  
  <p>Any help would be appreciated here as I have spent a lot of time trying to figure out what is the issue here, I guess it is some object scope issue for the wp engine, but I am not convinced.
      class DazSEO {
      public static $plugins = array();</p>
  
  <pre><code>public $metaBox;    
  
  public function __construct() {
  
      add_action('admin_init', array($this, 'adminInit') );
      add_action('init', array($this, 'init'));
  }
  
  public function adminInit() {
      $this-&gt;setupMetaBox();
  }    
  
  public function setupMetaBox() {   
      if( $pagenow === 'term.php' ) { // returns true
  
          if( isset($_GET['taxonomy']) ) { 
              $term = get_term( $_GET['tag_ID'], $_GET['taxonomy'], OBJECT );
  
              require_once('admin\metabox\TermMetaBox.php'); 
              $this-&gt;metaBox = new TermMetabox( $_GET['taxonomy'] ); // confirmed this does fire
  
              DazSEO::$mode = 'term';
              DazSEO::$wpID = $_GET['tag_ID'];
              DazSEO::$typeName = $_GET['taxonomy'];
          } 
      }
  }    
  }
  
  class TermMetabox extends MetaBoxBase {
    private $_taxonomy;
  
    public function __construct(string $taxonomy) {        
      if( strlen($taxonomy) === 0 ) { echo 'no taxonomy passed'; exit(); }
  
      $this-&gt;_taxonomy = $taxonomy;
  
      add_action(  $this-&gt;_taxonomy . '_edit_form', array($this, 'buildMetaBox') );       
  
      add_action('edit_terms', array($this, 'onTermSave')); // SETUP TERM SAVE     
  }
  
  
    public function loadHooks() {
  
  }
  
  
  // NOT BEING CALLED
  public function onTermSave(int $term_id) {
  
      echo '&lt;pre&gt;' . print_r($_REQUEST, 1) . '&lt;/pre&gt;'; exit(); 
  
      if( $this-&gt;onSaveChecks($term_id) ) {
          return;
      }
  
      foreach(DazSEO::$plugins as $plugin) {
          $plugin-&gt;onTermSave($term_id, $_REQUEST);
      }
  }
  }
  </code></pre>
  
  <p>The TermMetabox:: onTermSave never gets called</p>
  
  <p>If this is called from the root class (DazSEO), and I move the save method in there too it works...</p>
  
  <pre><code>add_action('edit_terms', array($this, 'onTermSave'));
  </code></pre>
  
  <p>But it's messy design like that.</p>
  
  <p>This plugin is initialized like this...</p>
  
  <pre><code>$dazSEO = new DazSEO();
  $wpCleanHeader = new RemoveWPHeaderJunk();
  $dazSEO-&gt;loadPlugin($wpCleanHeader);
  </code></pre>