wpseek.com
WordPress开发者和主题制作者的搜索引擎



wp_is_theme_directory_ignored › WordPress Function

Since6.0.0
已弃用n/a
wp_is_theme_directory_ignored ( $path )
参数:
  • (string) $path The path of the file in the theme.
    Required: Yes
返回:
  • (bool) Whether this file is in an ignored directory.
定义在:
文档:

Determines whether a theme directory should be ignored during export.



源码

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