wp_is_theme_directory_ignored()WP 6.0.0

Filters theme directories that should be ignored during export.

Хуков нет.

Возвращает

Bool. Whether this file is in an ignored directory.

Использование

wp_is_theme_directory_ignored( $path );
$path(строка) (обязательный)
The path of the file in the theme.

Список изменений

С версии 6.0.0 Введена.

Код wp_is_theme_directory_ignored() WP 6.0.1

function wp_is_theme_directory_ignored( $path ) {
	$directories_to_ignore = array( '.svn', '.git', '.hg', '.bzr', 'node_modules', 'vendor' );
	foreach ( $directories_to_ignore as $directory ) {
		if ( strpos( $path, $directory ) === 0 ) {
			return true;
		}
	}

	return false;
}