<?php
global $wpdb;
$ex=$wpdb->get_var($wpdb->prepare("SELECT post_id FROM {$wpdb->postmeta} WHERE meta_key='_fgj2wp_old_id' AND meta_value=%s","9082"));
if($ex){ echo "ya existe en prod: $ex\n"; return; }
$content=file_get_contents('/entrada/9082_content.html');
$id=wp_insert_post(["post_type"=>"post","post_status"=>"publish","post_author"=>890,
  "post_title"=>"El plan (casi definitivo) de León XIV en España, al descubierto: de Carabanchel a Arguineguín, pasando por Montserrat",
  "post_content"=>$content,"post_date"=>"2026-04-09 12:07:26","to_ping"=>"","pinged"=>"","post_content_filtered"=>""],true);
if(is_wp_error($id)){ echo "ERROR: ".$id->get_error_message()."\n"; return; }
update_post_meta($id,"_fgj2wp_old_id","9082");
wp_set_post_categories($id,[41]);
if(function_exists('pll_set_post_language')) pll_set_post_language($id,'es');
echo "creado prod $id cat=".implode(",",wp_get_post_categories($id))." status=".get_post_status($id)."\n";
