plugin_files_exclusions
Filter HookDescription
Filters the array of excluded directories and files while scanning the folder.Hook Information
File Location |
wp-admin/includes/plugin.php
View on GitHub
|
Hook Type | Filter |
Line Number | 247 |
Hook Parameters
Type | Name | Description |
---|---|---|
string[]
|
$exclusions
|
Array of excluded directories and files. |
Usage Examples
Basic Usage
<?php
// Hook into plugin_files_exclusions
add_filter('plugin_files_exclusions', 'my_custom_filter', 10, 1);
function my_custom_filter($exclusions) {
// Your custom filtering logic here
return $exclusions;
}
Source Code Context
wp-admin/includes/plugin.php:247
- How this hook is used in WordPress core
<?php
242 *
243 * @since 4.9.0
244 *
245 * @param string[] $exclusions Array of excluded directories and files.
246 */
247 $exclusions = (array) apply_filters( 'plugin_files_exclusions', array( 'CVS', 'node_modules', 'vendor', 'bower_components' ) );
248
249 $list_files = list_files( $dir, 100, $exclusions );
250 $list_files = array_map( 'plugin_basename', $list_files );
251
252 $plugin_files = array_merge( $plugin_files, $list_files );
PHP Documentation
<?php
/**
* Filters the array of excluded directories and files while scanning the folder.
*
* @since 4.9.0
*
* @param string[] $exclusions Array of excluded directories and files.
*/
Quick Info
- Hook Type: Filter
- Parameters: 1
- File: wp-admin/includes/plugin.php
Related Hooks
Related hooks will be displayed here in future updates.