wp_is_theme_directory_ignored

The timeline below displays how wordpress function wp_is_theme_directory_ignored has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

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;
}

WordPress Version: 6.1

/**
 * 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;
}