v1.2.0
This commit is contained in:
parent
6708bbb67f
commit
650e69349f
21 changed files with 2919 additions and 268 deletions
|
|
@ -172,4 +172,21 @@ class AttachmentIndexer {
|
|||
Scheduler::schedule_single( self::AS_HOOK );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from mra_media_index and mra_media_usage, forcing a full re-index on the next run.
|
||||
*
|
||||
* @return int Number of index rows removed.
|
||||
*/
|
||||
public static function reset_all(): int {
|
||||
global $wpdb;
|
||||
|
||||
// phpcs:disable WordPress.DB.DirectDatabaseQuery
|
||||
$count = (int) $wpdb->get_var( "SELECT COUNT(*) FROM {$wpdb->prefix}mra_media_index" );
|
||||
$wpdb->query( "DELETE FROM {$wpdb->prefix}mra_media_usage" );
|
||||
$wpdb->query( "DELETE FROM {$wpdb->prefix}mra_media_index" );
|
||||
// phpcs:enable WordPress.DB.DirectDatabaseQuery
|
||||
|
||||
return $count;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue