wp_is_theme_directory_ignored() WordPress Function

The wp_is_theme_directory_ignored() function is used to check if a theme directory is being ignored by WordPress.

wp_is_theme_directory_ignored( string $path ) #

Filters theme directories that should be ignored during export.


Parameters

$path

(string)(Required)The path of the file in the theme.


Top ↑

Return

(Bool) Whether this file is in an ignored directory.


Top ↑

Source

File: wp-includes/block-template-utils.php

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


Top ↑

Changelog

Changelog
VersionDescription
6.0.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.