feat(visibility): sistema de visibilidad por tipo de página
- Añadir PageVisibility use case y repositorio - Implementar PageTypeDetector para detectar home/single/page/archive - Actualizar FieldMappers con soporte show_on_[page_type] - Extender FormBuilders con UI de visibilidad por página - Refactorizar Renderers para evaluar visibilidad dinámica - Limpiar schemas removiendo campos de visibilidad legacy - Añadir MigrationCommand para migrar configuraciones existentes - Implementar adsense-loader.js para carga lazy de ads - Actualizar front-page.php con nueva estructura - Extender DIContainer con nuevos servicios 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -50,6 +50,13 @@ function roi_get_featured_image($post_id = null, $size = 'roi-featured-large', $
|
||||
return ''; // No placeholder - retornar vacío
|
||||
}
|
||||
|
||||
// Verificar que el archivo físico exista, no solo el attachment ID
|
||||
$thumbnailId = get_post_thumbnail_id($post_id);
|
||||
$filePath = get_attached_file($thumbnailId);
|
||||
if (empty($filePath) || !file_exists($filePath)) {
|
||||
return ''; // Archivo no existe en servidor
|
||||
}
|
||||
|
||||
// Obtener tipo de post
|
||||
$post_type = get_post_type($post_id);
|
||||
|
||||
@@ -145,6 +152,13 @@ function roi_get_post_thumbnail($post_id = null, $with_link = true) {
|
||||
return ''; // No placeholder - retornar vacío
|
||||
}
|
||||
|
||||
// Verificar que el archivo físico exista
|
||||
$thumbnailId = get_post_thumbnail_id($post_id);
|
||||
$filePath = get_attached_file($thumbnailId);
|
||||
if (empty($filePath) || !file_exists($filePath)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
// Obtener la imagen con clases Bootstrap
|
||||
$image = get_the_post_thumbnail($post_id, 'roi-featured-medium', array(
|
||||
'class' => 'img-fluid post-thumbnail',
|
||||
@@ -216,6 +230,13 @@ function roi_get_post_thumbnail_small($post_id = null, $with_link = true) {
|
||||
return ''; // No placeholder - retornar vacío
|
||||
}
|
||||
|
||||
// Verificar que el archivo físico exista
|
||||
$thumbnailId = get_post_thumbnail_id($post_id);
|
||||
$filePath = get_attached_file($thumbnailId);
|
||||
if (empty($filePath) || !file_exists($filePath)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
// Obtener la imagen
|
||||
$image = get_the_post_thumbnail($post_id, 'roi-thumbnail', array(
|
||||
'class' => 'img-fluid post-thumbnail-small',
|
||||
@@ -287,6 +308,13 @@ function roi_should_show_featured_image($post_id = null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Verificar que el archivo físico exista
|
||||
$thumbnailId = get_post_thumbnail_id($post_id);
|
||||
$filePath = get_attached_file($thumbnailId);
|
||||
if (empty($filePath) || !file_exists($filePath)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Obtener tipo de post
|
||||
$post_type = get_post_type($post_id);
|
||||
|
||||
@@ -338,6 +366,13 @@ function roi_get_featured_image_url($post_id = null, $size = 'roi-featured-large
|
||||
return ''; // No placeholder - retornar vacío
|
||||
}
|
||||
|
||||
// Verificar que el archivo físico exista
|
||||
$thumbnailId = get_post_thumbnail_id($post_id);
|
||||
$filePath = get_attached_file($thumbnailId);
|
||||
if (empty($filePath) || !file_exists($filePath)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
// Obtener URL de la imagen
|
||||
$image_url = get_the_post_thumbnail_url($post_id, $size);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user