fix(css-manager): add error logging to debug hook registration
- Wrap CustomCSSManager bootstrap in try-catch - Log success message when WP_DEBUG is enabled - Log detailed error with file/line on failure 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -307,6 +307,7 @@ add_action('wp_footer', function() use ($container) {
|
|||||||
*/
|
*/
|
||||||
// Registrar hooks de inyección CSS directamente (sin wrapper)
|
// Registrar hooks de inyección CSS directamente (sin wrapper)
|
||||||
if (!is_admin()) {
|
if (!is_admin()) {
|
||||||
|
try {
|
||||||
global $wpdb;
|
global $wpdb;
|
||||||
|
|
||||||
$repository = new \ROITheme\Admin\CustomCSSManager\Infrastructure\Persistence\WordPressSnippetRepository($wpdb);
|
$repository = new \ROITheme\Admin\CustomCSSManager\Infrastructure\Persistence\WordPressSnippetRepository($wpdb);
|
||||||
@@ -319,6 +320,13 @@ if (!is_admin()) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
$injector->register();
|
$injector->register();
|
||||||
|
|
||||||
|
if (defined('WP_DEBUG') && WP_DEBUG) {
|
||||||
|
error_log('ROI Theme: CustomCSSManager hooks registered successfully');
|
||||||
|
}
|
||||||
|
} catch (\Throwable $e) {
|
||||||
|
error_log('ROI Theme: CustomCSSManager FAILED: ' . $e->getMessage() . ' in ' . $e->getFile() . ':' . $e->getLine());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|||||||
Reference in New Issue
Block a user