Hey @chrislopo,
You could use this hook function to include all files:
/**
* Overwrite Media Sync plugin rules for skipping scanned files or folders.
*
* Should return bool value.
*
* @param boolean $is_ignored Default rules for this file/folder (skipping thumbnails, index.php, hidden files, etc.)
* @param string $full_path Each scanned file/folder absolute path
* @param string $file_name Each scanned file/folder name
* @return boolean
*/
function my_custom_media_sync_additional_file_skip($is_ignored, $full_path, $file_name)
{
// Custom logic here
return false;
}
add_filter('media_sync_filter_is_scan_object_ignored', 'my_custom_media_sync_additional_file_skip', 10, 3);
This would of course list all thumbnails generated by WordPress. So if you want to ignore those but not these from the CMS, you would have to write some custom logic using $file_name
. For example, this is what’s ignored by the plugin:
// If it contains image size at the end (i.e. -100x100.jpg) or ends with "-scaled" (also WP generated)
$is_ignored = preg_match('/(-scaled|[_-]\d+x\d+)(?=\.[a-z]{3,4}$)/im', $file_name) == true;
It’s on my to-do list to make UI for this, but I still didn’t get to do it.
Erol