668d973889
Incluye: mu-plugins custom (fea-homepage, carta-semana), scripts de migración/traducción/deploy, documentación de auditoría, análisis de cartas y HTML de evangelios exportados desde Joomla. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
6 lines
673 B
PHP
6 lines
673 B
PHP
<?php
|
|
$folder_id = 10;
|
|
$base_dir = '/var/www/html/wp-content/uploads/homilias_fray_marcos';
|
|
$name = 'homilias';
|
|
global $wpdb; $t = $wpdb->prefix.'fbv_attachment_folder';
|
|
$files = scandir($base_dir); $c=0; foreach($files as $f){if($f=='.'||$f=='..')continue; $p=$base_dir.'/'.$f; if(is_dir($p))continue; $id=$wpdb->get_var($wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE guid LIKE %s AND post_type='attachment'",'%'.$name.'/'.$f)); if(!$id){$id=trim(shell_exec("wp media import ".escapeshellarg($p)." --porcelain --allow-root")); if(is_numeric($id)){$wpdb->query("INSERT INTO $t (folder_id, attachment_id) VALUES ($folder_id, $id)"); $c++;}} } echo "Done. Imported: $c\n"; |