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:
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
$c=get_post(19112)->post_content;
|
||||
$map=[
|
||||
"el-bautismo-de-jesus-jesus-hijo-del-padre"=>17918, // Galarreta homenaje
|
||||
"jean-baptiste-et-son-mouton"=>17990, // Mardones homenaje
|
||||
"nuestra-vida-sea-servicio"=>23519, // Mari Patxi fallecimiento
|
||||
];
|
||||
$n=0;
|
||||
foreach($map as $slug=>$id){
|
||||
$url=get_permalink($id);
|
||||
$pat='#https?://[^"]*?/'.preg_quote($slug,'#').'/#';
|
||||
$c2=preg_replace($pat,$url,$c,1,$cnt);
|
||||
if($cnt>0){ $c=$c2; $n++; echo " OK $slug -> $url\n"; } else echo " NO ENCONTRADO $slug\n";
|
||||
}
|
||||
if($n) wp_update_post(["ID"=>19112,"post_content"=>$c]);
|
||||
// verificar 8 enlaces
|
||||
preg_match_all('#href="([^"]+)"#',get_post(19112)->post_content,$m);
|
||||
$ok=0;$bad=0;
|
||||
foreach($m[1] as $h){ if(preg_match('#/([^/"]+)/?$#',$h,$sm)){ $p=get_posts(["name"=>$sm[1],"post_status"=>"publish","posts_per_page"=>1,"suppress_filters"=>true]); if($p)$ok++; else {$bad++; echo " ROTO $h\n";} } }
|
||||
echo "repuntados=$n | enlaces in-memoriam OK=$ok bad=$bad\n";
|
||||
Reference in New Issue
Block a user