WordPress Version: 6.5
/**
* Determines whether a theme directory should be ignored during export.
*
* @since 6.0.0
*
* @param string $path The path of the file in the theme.
* @return bool Whether this file is in an ignored directory.
*/
function wp_is_theme_directory_ignored($path)
{
$directories_to_ignore = array('.DS_Store', '.svn', '.git', '.hg', '.bzr', 'node_modules', 'vendor');
foreach ($directories_to_ignore as $directory) {
if (str_starts_with($path, $directory)) {
return true;
}
}
return false;
}