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 |
---|---|
2677 | } |
2678 | } |
2679 |
|
2680 | /* |
2681 | * Check if an image will be converted after uploading or some existing image sub-size file names may conflict |
2682 | * when regenerated. If yes, ensure the new file name will be unique and will produce unique sub-sizes. |
2683 | */ |
2684 | if ( $is_image ) { |
2685 | /** This filter is documented in wp-includes/class-wp-image-editor.php */ |
2686 | $output_formats = apply_filters( 'image_editor_output_format', array(), $_dir . $filename, $mime_type ); |
2687 | $alt_types = array(); |
2688 |
|
2689 | if ( ! empty( $output_formats[ $mime_type ] ) ) { |
2690 | // The image will be converted to this format/mime type. |
2691 | $alt_mime_type = $output_formats[ $mime_type ]; |
2692 |
|
2693 | // Other types of images whose names may conflict if their sub-sizes are regenerated. |
2694 | $alt_types = array_keys( array_intersect( $output_formats, array( $mime_type, $alt_mime_type ) ) ); |
2695 | $alt_types[] = $alt_mime_type; |