FIX moving function to mu-plugin
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
fdd5d85299
commit
3c9fbf138c
|
|
@ -517,38 +517,3 @@ function get_search_snippet($post_id, $search_term, $context_length = 150)
|
|||
|
||||
return $snippet;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Helper sécurisé pour récupérer le focal point (avec fallback si plugin désactivé)
|
||||
*
|
||||
* @param int|null $post_id ID du post (null pour le post courant)
|
||||
* @return array Tableau avec 'x' et 'y' (valeurs entre 0 et 1)
|
||||
*/
|
||||
function safe_get_thumbnail_focal_point($post_id = null)
|
||||
{
|
||||
// Vérifier si la fonction du plugin existe
|
||||
if (function_exists('get_thumbnail_focal_point')) {
|
||||
return get_thumbnail_focal_point($post_id);
|
||||
}
|
||||
|
||||
// Fallback : centre de l'image par défaut
|
||||
return ['x' => 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%';
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user