wpseek.com
Bazujące na WordPress narzędzie wyszukiwania dla deweloperów i twórców motywów.



wp_is_theme_directory_ignored › WordPress Function

Od6.0.0
Przestarzałyn/a
› wp_is_theme_directory_ignored ( $path )
Parametry:
  • (string) $path The path of the file in the theme.
    Wymagane: Tak
Powrót:
  • (bool) Whether this file is in an ignored directory.
Zdefiniowane na:
Codex:

Determines whether a theme directory should be ignored during export.



Źródło

function wp_is_theme_directory_ignored( $path ) {
	$directories_to_ignore = array( '.DS_Store', '.svn', '.git', '.hg', '.bzr', 'node_modules', 'vendor' );

	return array_any( $directories_to_ignore, fn( $directory ) => str_starts_with( $path, $directory ) );
}