From e46b8de1cb37d8979f9442cb9dce078361be4060 Mon Sep 17 00:00:00 2001 From: Brasdrive Date: Sun, 9 Nov 2025 21:57:24 -0400 Subject: [PATCH] 3.0.0 --- src/Plugin.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/Plugin.php b/src/Plugin.php index 316a3a1..8b9da31 100644 --- a/src/Plugin.php +++ b/src/Plugin.php @@ -32,6 +32,11 @@ class Plugin */ private static bool $initialized = false; + /** + * Instancia de MediaHooks + */ + private static ?MediaHooks $mediaHooks = null; + /** * Bootstrap del plugin * @@ -63,8 +68,9 @@ class Plugin // Registrar stream wrapper FlysystemStreamWrapper::register(self::$filesystem); - // Registrar hooks de medios - MediaHooks::register(self::$config); + // Registrar hooks de medios (instanciar la clase) + self::$mediaHooks = new MediaHooks(self::$filesystem, self::$config); + self::$mediaHooks->register(); // Registrar página de ajustes if (is_admin()) { @@ -78,7 +84,7 @@ class Plugin } catch (Throwable $e) { error_log('[Flysystem Offload] Initialization error: ' . $e->getMessage()); error_log('[Flysystem Offload] Stack trace: ' . $e->getTraceAsString()); - + self::registerAdminNotice( 'Failed to initialize: ' . $e->getMessage() ); @@ -147,6 +153,7 @@ class Plugin { self::$initialized = false; self::$filesystem = null; + self::$mediaHooks = null; self::$config = []; // Desregistrar stream wrapper si existe