/** * Initiate our hooks * * @since 0.1.0 * @return void */ public function hooks() { parent::hooks(); add_filter('pre_option_' . $this->key, array($this, 'get_option_override')); // Override CMB's getter add_filter('cmb2_override_option_get_' . $this->key, array($this, 'get_override'), 10, 2); // Override CMB's setter add_filter('cmb2_override_option_save_' . $this->key, array($this, 'update_override'), 10, 2); }
/** * Add hooks and filters * * @since 0.1.0 * @return void */ public function hooks() { add_action('plugins_loaded', array($this, 'init')); $this->settings->hooks(); }