scripts(homenajes): migración Mardones/Galarreta + sync prod #130/#131/#133/#137/#138

Pipeline de los 23 posts de Mardones (anterior/*.htm → posts), repunte de
presentaciones de Galarreta, y scripts de sync a prod de las 5 issues del día.
Incluye retoques de fecha (2012-10-10) y eliminación de target=_blank en el
homenaje 17990.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-23 09:06:39 -04:00
parent e26b279e63
commit a2aefd8e0b
13 changed files with 536 additions and 0 deletions
@@ -0,0 +1,23 @@
<?php
// 1) reasignaciones de idioma (mismos IDs en prod)
$fix=[4424=>"fr",11129=>"it",12934=>"en",5891=>"en",3141=>"it"];
foreach($fix as $id=>$lang){
if(!get_post($id)){ echo " $id NO EXISTE\n"; continue; }
$old=pll_get_post_language($id); pll_set_post_language($id,$lang);
echo " $id: $old -> ".pll_get_post_language($id)."\n";
}
// 2) sobrescribir fr malos + catalan con francés correcto (overwrite en sitio)
$payload=json_decode(file_get_contents('/entrada/fr_payload.json'),true);
foreach($payload as $it){
$dst=$it['dst'];
if(!get_post($dst)){ echo " dst $dst NO EXISTE\n"; continue; }
wp_update_post(["ID"=>$dst,"post_title"=>$it['title'],"post_content"=>$it['content']]);
pll_set_post_language($dst,'fr');
echo " overwrite $dst -> fr (".mb_substr($it['title'],0,30).")\n";
}
// 3) catalan 13339: enlazar grupo con ES 13338
if(get_post(13338) && get_post(13339)){
pll_set_post_language(13338,'es');
pll_save_post_translations(["es"=>13338,"fr"=>13339]);
echo " grupo 13339: ".json_encode(pll_get_post_translations(13339))."\n";
}