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 |
---|---|
81 | */ |
82 | public function load() { |
83 | if ( $this->image ) |
84 | return true; |
85 |
|
86 | if ( ! is_file( $this->file ) && ! preg_match( '|^https?://|', $this->file ) ) |
87 | return new WP_Error( 'error_loading_image', __('File doesn’t exist?'), $this->file ); |
88 |
|
89 | // Set artificially high because GD uses uncompressed images in memory |
90 | @ini_set( 'memory_limit', apply_filters( 'image_memory_limit', WP_MAX_MEMORY_LIMIT ) ); |
91 | $this->image = @imagecreatefromstring( file_get_contents( $this->file ) ); |
92 |
|
93 | if ( ! is_resource( $this->image ) ) |
94 | return new WP_Error( 'invalid_image', __('File is not an image.'), $this->file ); |
95 |
|
96 | $size = @getimagesize( $this->file ); |
97 | if ( ! $size ) |
98 | return new WP_Error( 'invalid_image', __('Could not read image size.'), $this->file ); |
99 |
|