WPBP / WordPress-Plugin-Boilerplate-Powered

Wordpress Plugin Boilerplate but Powered with examples and a generator!
https://wpbp.github.io/
GNU General Public License v3.0
791 stars 114 forks source link

[Feature] initialize exclude ~ in filenames #215

Closed Mte90 closed 2 years ago

Mte90 commented 2 years ago
private function scandir( string $folder ) {
        $temp_files = \scandir( $folder );
        $files  = array();

        if ( \is_array( $temp_files ) ) {
            foreach( $temp_files as $key => $file ) {
                if ( \strpos( $file, '~' ) === false ) {
                    $files[] = $file;
                }
            }
        }

        return \array_diff( $files, array( '..', '.', 'index.php' ) );
    }

https://github.com/WPBP/WordPress-Plugin-Boilerplate-Powered/blob/master/plugin-name/engine/Initialize.php