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