fix(avatares): traducciones de lecturas heredan el símbolo del ES (#135/#66)
fea_avatar_url: para posts no-ES resuelve el título del original ES (Polylang), donde sí se reconoce el libro/evangelista. Así Matteo/Geremia/Romani heredan el mismo icono que Mateo(ángel)/Jeremías/Romanos(biblia) en vez de identicon random. También incluye el guard de Multimedia solo-ES (#135 #1). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -839,6 +839,16 @@ function fea_avatar_url(object $post, int $size, int $author_id, string $author_
|
|||||||
// Solo la LECTURA en sí (cuyo título es la cita, p.ej. "Mateo 9, 36") lleva símbolo de
|
// Solo la LECTURA en sí (cuyo título es la cita, p.ej. "Mateo 9, 36") lleva símbolo de
|
||||||
// evangelista; los comentaristas humanos conservan su avatar aunque comenten ese evangelio.
|
// evangelista; los comentaristas humanos conservan su avatar aunque comenten ese evangelio.
|
||||||
$title = (string) $post->post_title;
|
$title = (string) $post->post_title;
|
||||||
|
// Las traducciones tienen el título en su idioma (Matteo, Geremia, Romani…) que no
|
||||||
|
// reconocemos. Usamos el título del ORIGINAL ES, donde sí detectamos el libro → la
|
||||||
|
// traducción hereda el mismo símbolo que el ES (#135).
|
||||||
|
if (function_exists('pll_get_post_language') && pll_get_post_language($post->ID) !== 'es') {
|
||||||
|
$es = function_exists('pll_get_post') ? pll_get_post($post->ID, 'es') : 0;
|
||||||
|
if ($es) {
|
||||||
|
$esp = get_post($es);
|
||||||
|
if ($esp) $title = (string) $esp->post_title;
|
||||||
|
}
|
||||||
|
}
|
||||||
if ($ev = fea_evangelista_de_texto($title)) return $base . $ev . '.svg';
|
if ($ev = fea_evangelista_de_texto($title)) return $base . $ev . '.svg';
|
||||||
if (fea_es_libro_biblico($title) || fea_es_libro_biblico($author_name)) return $base . 'biblia.svg';
|
if (fea_es_libro_biblico($title) || fea_es_libro_biblico($author_name)) return $base . 'biblia.svg';
|
||||||
return get_avatar_url($author_id, ['size' => $size, 'default' => 'identicon']);
|
return get_avatar_url($author_id, ['size' => $size, 'default' => 'identicon']);
|
||||||
@@ -1276,6 +1286,9 @@ add_shortcode('fea_eucaristia', function($atts) {
|
|||||||
// Fallbacks: ACF portada_multimedia → últimos por categoría.
|
// Fallbacks: ACF portada_multimedia → últimos por categoría.
|
||||||
add_shortcode('fea_multimedia', function($atts) {
|
add_shortcode('fea_multimedia', function($atts) {
|
||||||
$lang = fea_current_lang();
|
$lang = fea_current_lang();
|
||||||
|
// Multimedia es contenido ES y externo (sin traducir) → solo se muestra en
|
||||||
|
// español de momento; en otros idiomas la sección se oculta (#135).
|
||||||
|
if ($lang !== 'es') return '';
|
||||||
$labels = fea_labels();
|
$labels = fea_labels();
|
||||||
$atts = shortcode_atts(['titulo' => $labels['multimedia']], $atts);
|
$atts = shortcode_atts(['titulo' => $labels['multimedia']], $atts);
|
||||||
$page = fea_front_page_id();
|
$page = fea_front_page_id();
|
||||||
|
|||||||
Reference in New Issue
Block a user