wp_is_theme_directory_ignored()
Determines whether a theme directory should be ignored during export.
No Hooks.
Returns
true|false. Whether this file is in an ignored directory.
Usage
wp_is_theme_directory_ignored( $path );
- $path(string) (required)
- The path of the file in the theme.
Changelog
| Since 6.0.0 | Introduced. |
wp_is_theme_directory_ignored() wp is theme directory ignored code WP 6.9.1
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;
}