sqlite_files() as $sqlite_file ) { if ( basename( $sqlite_file ) === basename( $file ) ) { return true; } } } return $filter; } /** * Filter for BackWPUp backup exclusion * * @param string $list Comma-separated list of files to skip. * * @return string Comma-separated list of files to skip. */ public function backwpup_file_exclude( $list ) { global $wp_object_cache; $files = []; $files [] = $list; if ( method_exists( $wp_object_cache, 'sqlite_files' ) ) { foreach ( $wp_object_cache->sqlite_files() as $file ) { $files [] = basename( $file ); } } return implode( ',', $files ); } /** * Filter for WP STAGING cloning and pushing exclusion * * @param array $files * * @return array */ public function wpstg_clone_excluded_files( $files ) { global $wp_object_cache; if ( method_exists( $wp_object_cache, 'sqlite_files' ) ) { foreach ( $wp_object_cache->sqlite_files() as $file ) { $files [] = basename( $file ); } } return $files; } }