Created
May 27, 2024 21:16
-
-
Save ideadude/f5a4d8213ac9e660c31db6f9b7f1d780 to your computer and use it in GitHub Desktop.
Exclude some extra dirs from the WordPress plugin check plugin.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Exclude some extra dirs from the WordPress plugin check plugin. | |
*/ | |
function my_wp_plugin_check_ignore_directories( $dirs ) { | |
// For reference, the default dirs as of v1.0.1 | |
// $default_ignore_directories = array( | |
// '.git', | |
// 'vendor', | |
// 'node_modules', | |
// ); | |
$extra_dirs = array( | |
'.DS_Store', | |
'.changelogs', | |
'.config', | |
'.github', | |
'.source', | |
'.wordpress-org', | |
'_private', | |
'dist', | |
'docs', | |
'tests', | |
'tmp' | |
); | |
return array_unique( array_merge( $dirs, $extra_dirs ) ); | |
} | |
add_filter( 'wp_plugin_check_ignore_directories' , 'my_wp_plugin_check_ignore_directories' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment