unzip_file_use_ziparchive

unzip_file_use_ziparchive

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

See hook in core

Displaying hooks found in version: wordpress-6.7.1

apply_filters('unzip_file_use_ziparchive') is found 2 times:

  • /wp-admin/includes/file.php line 1555
     * @return bool Whether the file is a valid ZIP file.
     */
    function wp_zip_file_is_valid( $file ) {
    	/** 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, ZipArchive::CHECKCONS );
    		if ( true === $archive_is_valid ) {
    			$archive->close();
    			return true;
    		}
    
  • /wp-admin/includes/file.php line 1632
    	 * @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;