wphooks.info - theme_scandir_exclusions

theme_scandir_exclusions

*** New in v4.8 ***

The hook occurs in the following file:

wp-includes/class-wp-theme.php:
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
		$results = scandir( $path );
		$files = array();

		/**
		 * Filters the array of excluded directories and files while scanning theme folder.
		 *
 		 * @since 4.7.4
		 *
		 * @param array $exclusions Array of excluded directories and files.
		 */
		$exclusions = (array) apply_filters( 'theme_scandir_exclusions', array( 'CVS', 'node_modules' ) );

		foreach ( $results as $result ) {
			if ( '.' == $result[0] || in_array( $result, $exclusions, true ) ) {
				continue;
			}
			if ( is_dir( $path . '/' . $result ) ) {
				if ( ! $depth )
					continue;
				$found = self::scandir( $path . '/' . $result, $extensions, $depth - 1 , $relative_path . $result );