build -> store -> return. */ class AIAAS_Export_Service { public function formats() { return AIAAS_Export_Registry::all(); } public function can_export( $format_key ) { $fmt = AIAAS_Export_Registry::get( $format_key ); if ( ! $fmt ) return false; // Feature gating (future): if registry exists, honor it. if ( class_exists( 'AIAAS_Feature_Registry' ) && ! empty( $fmt['feature'] ) ) { return AIAAS_Feature_Registry::active( $fmt['feature'] ); } return true; } /** * Placeholder build method (not yet wired to UI). */ public function build( $format_key, $context = array() ) { $fmt = AIAAS_Export_Registry::get( $format_key ); if ( ! $fmt || empty( $fmt['handler'] ) || ! is_callable( $fmt['handler'] ) ) { return new WP_Error( 'aiaas_export_no_handler', __( 'Export handler not registered.', 'aas-ai-authors-studio' ) ); } return call_user_func( $fmt['handler'], $context ); } }