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 |
---|---|
3654 | * |
3655 | * Allows to add filters to modify the way a cropped image is saved. |
3656 | * |
3657 | * @since 4.3.0 |
3658 | * |
3659 | * @param string $context The Customizer control requesting the cropped image. |
3660 | * @param int $attachment_id The attachment ID of the original image. |
3661 | * @param string $cropped Path to the cropped image file. |
3662 | */ |
3663 | do_action( 'wp_ajax_crop_image_pre_save', $context, $attachment_id, $cropped ); |
3664 |
|
3665 | /** This filter is documented in wp-admin/custom-header.php */ |
3666 | $cropped = apply_filters( 'wp_create_file_in_uploads', $cropped, $attachment_id ); // For replication. |
3667 |
|
3668 | $parent_url = wp_get_attachment_url( $attachment_id ); |
3669 | $url = str_replace( wp_basename( $parent_url ), wp_basename( $cropped ), $parent_url ); |
3670 |
|
3671 | $size = @getimagesize( $cropped ); |
3672 | $image_type = ( $size ) ? $size['mime'] : 'image/jpeg'; |