load_image_to_edit
Filters the current image being loaded for editing.
Description
Parameters (3)
- 0. $image (resource)
- Current image.
- 1. $attachment_id (string)
- The attachment id.
- 2. $size (string)
- Image size.
Usage
- To run the hook, copy the example below.
- $image = apply_filters( 'load_image_to_edit', $image, $attachment_id, $size );
- if ( !empty( $image ) ) {
- // everything has led up to this point...
- }
- The following example is for adding a hook callback.
- // define the load_image_to_edit callback
- function filter_load_image_to_edit( $image, $attachment_id, $size ) {
- // make filter magic happen here...
- return $image;
- };
- // add the filter
- add_filter( 'load_image_to_edit', 'filter_load_image_to_edit', 10, 3 );
- To remove a hook callback, use the example below.
- // remove the filter
- remove_filter( 'load_image_to_edit', 'filter_load_image_to_edit', 10, 3 );
Defined (1)
The filter is defined in the following location(s).
- /wp-admin/includes/image.php
- $image = apply_filters( 'load_image_to_edit', $image, $attachment_id, $size );