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 |
|---|---|
| 248 | $file = get_attached_file( $file ); |
| 249 | |
| 250 | if ( ! file_exists( $file ) ) |
| 251 | return sprintf(__('File “%s” doesn’t exist?'), $file); |
| 252 | |
| 253 | if ( ! function_exists('imagecreatefromstring') ) |
| 254 | return __('The GD image library is not installed.'); |
| 255 | |
| 256 | // Set artificially high because GD uses uncompressed images in memory |
| 257 | @ini_set( 'memory_limit', apply_filters( 'image_memory_limit', WP_MAX_MEMORY_LIMIT ) ); |
| 258 | $image = imagecreatefromstring( file_get_contents( $file ) ); |
| 259 | |
| 260 | if ( !is_resource( $image ) ) |
| 261 | return sprintf(__('File “%s” is not an image.'), $file); |
| 262 | |
| 263 | return $image; |
| 264 | } |
| 265 | |
| 266 | /** |