unzip_file_use_ziparchive

unzip_file_use_ziparchive

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: wordpress-6.4.3

apply_filters('unzip_file_use_ziparchive') is found 2 times:

  • /wp-admin/includes/class-file-upload-upgrader.php line 76
    			if ( 'pluginzip' === $form || 'themezip' === $form ) {
    				$archive_is_valid = false;
    
    				/** This filter is documented in wp-admin/includes/file.php */
    				if ( class_exists( 'ZipArchive', false ) && apply_filters( 'unzip_file_use_ziparchive', true ) ) {
    					$archive          = new ZipArchive();
    					$archive_is_valid = $archive->open( $file['file'], ZIPARCHIVE::CHECKCONS );
    
    					if ( true === $archive_is_valid ) {
    						$archive->close();
    					}
    
  • /wp-admin/includes/file.php line 1625
    	 * @since 3.0.0
    	 *
    	 * @param bool $ziparchive Whether to use ZipArchive. Default true.
    	 */
    	if ( class_exists( 'ZipArchive', false ) && apply_filters( 'unzip_file_use_ziparchive', true ) ) {
    		$result = _unzip_file_ziparchive( $file, $to, $needed_dirs );
    		if ( true === $result ) {
    			return $result;
    		} elseif ( is_wp_error( $result ) ) {
    			if ( 'incompatible_archive' !== $result->get_error_code() ) {
    				return $result;