Determines whether a theme directory should be ignored during export.
$pathstringrequired
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;
}
| Version | Description |
|---|---|
| 6.0.0 | Introduced. |
© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_is_theme_directory_ignored