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.
This hook occurs 2 times in this file.
| Line | Code |
|---|---|
| 46 | } |
| 47 | |
| 48 | /** |
| 49 | * Shows the settings in the Image Editor that allow selecting to edit only the thumbnail of an image. |
| 50 | * |
| 51 | * @since 6.3.0 |
| 52 | * |
| 53 | * @param bool $show Whether to show the settings in the Image Editor. Default false. |
| 54 | */ |
| 55 | $edit_thumbnails_separately = (bool) apply_filters( 'image_edit_thumbnails_separately', false ); |
| 56 | |
| 57 | ?> |
| 58 | <div class="imgedit-wrap wp-clearfix"> |
| 59 | <div id="imgedit-panel-<?php echo $post_id; ?>"> |
| 60 | <?php echo $note; ?> |
| 61 | <div class="imgedit-panel-content imgedit-panel-tools wp-clearfix"> |
| 62 | <div class="imgedit-menu wp-clearfix"> |
| 63 | <button type="button" onclick="imageEdit.toggleCropTool( <?php echo "$post_id, '$nonce'"; ?>, this );" aria-expanded="false" aria-controls="imgedit-crop" class="imgedit-crop button disabled" disabled><?php esc_html_e( 'Crop' ); ?></button> |
| 64 | <button type="button" class="imgedit-scale button" onclick="imageEdit.toggleControls(this);" aria-expanded="false" aria-controls="imgedit-scale"><?php esc_html_e( 'Scale' ); ?></button> |
| Line | Code |
| 898 | return $return; |
| 899 | } |
| 900 | |
| 901 | $full_width = ! empty( $_REQUEST['fwidth'] ) ? (int) $_REQUEST['fwidth'] : 0; |
| 902 | $full_height = ! empty( $_REQUEST['fheight'] ) ? (int) $_REQUEST['fheight'] : 0; |
| 903 | $target = ! empty( $_REQUEST['target'] ) ? preg_replace( '/[^a-z0-9_-]+/i', '', $_REQUEST['target'] ) : ''; |
| 904 | $scale = ! empty( $_REQUEST['do'] ) && 'scale' === $_REQUEST['do']; |
| 905 | |
| 906 | /** This filter is documented in wp-admin/includes/image-edit.php */ |
| 907 | $edit_thumbnails_separately = (bool) apply_filters( 'image_edit_thumbnails_separately', false ); |
| 908 | |
| 909 | if ( $scale ) { |
| 910 | $size = $img->get_size(); |
| 911 | $original_width = $size['width']; |
| 912 | $original_height = $size['height']; |
| 913 | |
| 914 | if ( $full_width > $original_width || $full_height > $original_height ) { |
| 915 | $return->error = esc_js( __( 'Images cannot be scaled to a size larger than the original.' ) ); |
| 916 | return $return; |