From c3b56f01af73fd3c501ce9b405ef54132150ff27 Mon Sep 17 00:00:00 2001 From: Antoine M Date: Thu, 16 Oct 2025 12:35:09 +0200 Subject: [PATCH] FIX Introducing the shared-utilities file --- mu-plugins/utilities.php | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 mu-plugins/utilities.php diff --git a/mu-plugins/utilities.php b/mu-plugins/utilities.php new file mode 100644 index 0000000..6b9d996 --- /dev/null +++ b/mu-plugins/utilities.php @@ -0,0 +1,35 @@ + 0.5, 'y' => 0.5]; +} + +/** + * Helper sécurisé pour récupérer le focal point au format CSS (avec fallback si plugin désactivé) + * + * @param int|null $post_id ID du post (null pour le post courant) + * @return string Format "50% 50%" pour object-position ou background-position + */ +function safe_get_thumbnail_focal_point_css($post_id = null) +{ + // Vérifier si la fonction du plugin existe + if (function_exists('get_thumbnail_focal_point_css')) { + return get_thumbnail_focal_point_css($post_id); + } + + // Fallback : centre de l'image par défaut + return '50% 50%'; +}