wpseek.com
Uma área de pesquisa sobre o WordPress para devs e autores do tema



wp_is_theme_directory_ignored › WordPress Function

Desde6.0.0
Obsoleton/a
› wp_is_theme_directory_ignored ( $path )
Parâmetros:
  • (string) $path The path of the file in the theme.
    Required: Yes
Retorna:
  • (bool) Whether this file is in an ignored directory.
Definido em:
Codex:

Determines whether a theme directory should be ignored during export.



Fonte

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