On this page
wp_is_theme_directory_ignored( string $path ): Bool
Determines whether a theme directory should be ignored during export.
Parameters
$pathstring Required-
The path of the file in the theme.
Return
Bool Whether this file is in an ignored directory.
Source
File: wp-includes/block-template-utils.php. View all references
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;
}
Related
Used By
| Used By | Description |
|---|---|
| wp_generate_block_templates_export_file() wp-includes/block-template-utils.php | Creates an export of the current templates and template parts from the site editor at the specified path in a ZIP file. |
Changelog
| Version | Description |
|---|---|
| 6.0.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_is_theme_directory_ignored