$file_list ) { foreach ( $file_list as $state => $value ) { if ( is_array( $value ) ) { foreach( $value as $filenames ) { foreach( $filenames as $filename => $t ) { if ( $type == 'wpcache' ) { $filename = dirname( $filename ); } if ( false == isset( $return_list[ $type ][ $state ] ) || false == in_array( $filename, $return_list[ $type ][ $state ] ) ) $return_list[ $type ][ $state ][] = $filename; } } } } if ( isset ( $return_list[ $type ] ) ) { $list[ $type ] = $return_list[ $type ]; } unset( $return_list[ $type ] ); } return rest_ensure_response( $list ); } }