API Key guardada.
Pelis24 - Ver Películas Online Gratis en Español Latino
Ver Películas Online Gratis en Latino, Castellano y Subtitulado sin registrarse. Ver estrenos de películas y también las mejores películas en HD 1080p.
API Key guardada.
‘;
}
$key = get_option(‘tmdb_api_key’);
echo ‘
‘;
});
});
// 2. Meta box para el enlace online
add_action(‘add_meta_boxes’, function() {
add_meta_box(‘link_online_box’, ‘Enlace de Reproducción’, function($post) {
$val = get_post_meta($post->ID, ‘link_online’, true);
echo ‘‘;
}, ‘post’, ‘side’, ‘high’);
});
add_action(‘save_post’, function($post_id) {
if (isset($_POST[‘link_online’])) {
update_post_meta($post_id, ‘link_online’, sanitize_text_field($_POST[‘link_online’]));
}
});
// 3. El Shortcode/Ficha Técnica
function mostrar_ficha_pelicula() {
global $post;
$post_id = $post->ID;
// Solo si hay datos importados
$titulo = get_post_meta($post_id, ‘titulo_original’, true);
if (!$titulo) return »;
$link_online = get_post_meta($post_id, ‘link_online’, true);
$trailer_id = get_post_meta($post_id, ‘trailer_youtube’, true);
$html = ‘
‘;
if ($link_online) {
$html .= ‘
‘;
}
if ($trailer_id) {
$html .= ‘
‘;
}
$html .= ‘
‘;
return $html;
}
add_shortcode(‘ficha_pelicula’, ‘mostrar_ficha_pelicula’);
// 4. Inyectar automáticamente
add_filter(‘the_content’, function($content) {
if (is_single()) {
return $content . mostrar_ficha_pelicula();
}
return $content;
});