wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes



wp_is_theme_directory_ignored › WordPress Function

Depuis6.0.0
Dépréciéen/a
› wp_is_theme_directory_ignored ( $path )
Paramètres:
  • (string) $path The path of the file in the theme.
    Requis: Oui
Retourne:
  • (bool) Whether this file is in an ignored directory.
Défini(e) dans:
Codex:

Determines whether a theme directory should be ignored during export.



Source

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