WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )apply_filters( "hook_name", "what_to_filter" ).Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
This hook occurs 2 times in this file.
| Line | Code |
|---|---|
| 1821 | * |
| 1822 | * @since 6.4.0 |
| 1823 | * |
| 1824 | * @param true|WP_Error $result The result of unzipping the archive. True on success, otherwise WP_Error. Default true. |
| 1825 | * @param string $file Full path and filename of ZIP archive. |
| 1826 | * @param string $to Full path on the filesystem the archive was extracted to. |
| 1827 | * @param string[] $needed_dirs A full list of required folders that were created. |
| 1828 | * @param float $required_space The space required to unzip the file and copy its contents, with a 10% buffer. |
| 1829 | */ |
| 1830 | $result = apply_filters( 'unzip_file', true, $file, $to, $needed_dirs, $required_space ); |
| 1831 | |
| 1832 | unset( $needed_dirs ); |
| 1833 | |
| 1834 | return $result; |
| 1835 | } |
| 1836 | |
| 1837 | /** |
| 1838 | * Attempts to unzip an archive using the PclZip library. |
| 1839 | * |
| Line | Code |
| 1963 | continue; |
| 1964 | } |
| 1965 | |
| 1966 | if ( ! $wp_filesystem->put_contents( $to . $file['filename'], $file['content'], FS_CHMOD_FILE ) ) { |
| 1967 | return new WP_Error( 'copy_failed_pclzip', __( 'Could not copy file.' ), $file['filename'] ); |
| 1968 | } |
| 1969 | } |
| 1970 | |
| 1971 | /** This action is documented in src/wp-admin/includes/file.php */ |
| 1972 | $result = apply_filters( 'unzip_file', true, $file, $to, $needed_dirs, $required_space ); |
| 1973 | |
| 1974 | unset( $needed_dirs ); |
| 1975 | |
| 1976 | return $result; |
| 1977 | } |
| 1978 | |
| 1979 | /** |
| 1980 | * Copies a directory from one location to another via the WordPress Filesystem |
| 1981 | * Abstraction. |