public function save_data($post_id) { global $post; if (is_object($post) && self::CPT_NAME !== $post->post_type) { return; } $input = new SpectrOMInput(); // TODO: nonce verification $form_data = $_POST['spectrom_metabox']; $this->_create_settings($post_id); $valid = new SpectrOMValidation(); if ($valid->validate_all($this->_settings, $form_data)) { // save meta data } }