wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



wp_is_theme_directory_ignored › WordPress Function

Seit6.0.0
Veraltetn/v
wp_is_theme_directory_ignored ( $path )
Parameter:
  • (string) $path The path of the file in the theme.
    Erforderlich: Ja
Gibt zurück:
  • (bool) Whether this file is in an ignored directory.
Definiert in:
Codex:

Determines whether a theme directory should be ignored during export.



Quellcode

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