<?php
// 1) fecha: alinear con el homenaje 17990 (2012-10-10)
$date="2012-10-10 19:26:00"; $gmt=get_gmt_from_date($date);
$ids=get_posts(["meta_key"=>"_mardones_src","post_type"=>"post","posts_per_page"=>-1,"fields"=>"ids","post_status"=>"any","suppress_filters"=>true]);
$nd=0;
foreach($ids as $id){ wp_update_post(["ID"=>$id,"post_date"=>$date,"post_date_gmt"=>$gmt]); $nd++; }
echo "fechas actualizadas: $nd posts -> $date\n";
// 2) quitar target=_blank (y rel) de los enlaces internos del homenaje 17990
$c=get_post(17990)->post_content;
$before=substr_count(strtolower($c),'target="_blank"');
$c=str_replace([' target="_blank"',' rel="noopener"',' rel="noreferrer"'],'',$c);
wp_update_post(["ID"=>17990,"post_content"=>$c]);
$after=substr_count(strtolower(get_post(17990)->post_content),'target="_blank"');
echo "target=_blank en 17990: antes=$before despues=$after\n";
