wphooks.info - plugin_files_exclusions

plugin_files_exclusions

*** New in v4.9 ***

The hook occurs in the following file:

wp-admin/includes/plugin.php:
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
	if ( is_dir( $dir ) && WP_PLUGIN_DIR !== $dir ) {

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

		$list_files = list_files( $dir, 100, $exclusions );
		$list_files = array_map( 'plugin_basename', $list_files );

		$plugin_files = array_merge( $plugin_files, $list_files );
		$plugin_files = array_values( array_unique( $plugin_files ) );
	}

	set_transient( $transient_key, $plugin_files, HOUR_IN_SECONDS );