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.
| Line | Code |
|---|---|
| 1880 | |
| 1881 | // Set correct file permissions |
| 1882 | $stat = stat( dirname( $new_file )); |
| 1883 | $perms = $stat['mode'] & 0000666; |
| 1884 | @ chmod( $new_file, $perms ); |
| 1885 | |
| 1886 | // Compute the URL |
| 1887 | $url = $uploads['url'] . "/$filename"; |
| 1888 | |
| 1889 | $return = apply_filters( 'wp_handle_upload', array( 'file' => $new_file, 'url' => $url, 'type' => $type ) ); |
| 1890 | |
| 1891 | return $return; |
| 1892 | } |
| 1893 | |
| 1894 | function wp_shrink_dimensions( $width, $height, $wmax = 128, $hmax = 96 ) { |
| 1895 | if ( $height <= $hmax && $width <= $wmax ) |
| 1896 | return array( $width, $height); |
| 1897 | elseif ( $width / $height > $wmax / $hmax ) |
| 1898 | return array( $wmax, (int) ($height / $width * $wmax )); |