Filter hook 'image_edit_thumbnails_separately'

in WP Core File wp-admin/includes/image-edit.php at line 927

View Source

image_edit_thumbnails_separately

Filter Hook
Description
Saves image to post, along with enqueued changes in `$_REQUEST['history']`.

Hook Information

File Location wp-admin/includes/image-edit.php View on GitHub
Hook Type Filter
Line Number 927

Hook Parameters

Type Name Description
int $post_id Attachment post ID.

Usage Examples

Basic Usage
<?php
// Hook into image_edit_thumbnails_separately
add_filter('image_edit_thumbnails_separately', 'my_custom_filter', 10, 1);

function my_custom_filter($post_id) {
    // Your custom filtering logic here
    return $post_id;
}

Source Code Context

wp-admin/includes/image-edit.php:927 - How this hook is used in WordPress core
<?php
 922  	$full_height = ! empty( $_REQUEST['fheight'] ) ? (int) $_REQUEST['fheight'] : 0;
 923  	$target      = ! empty( $_REQUEST['target'] ) ? preg_replace( '/[^a-z0-9_-]+/i', '', $_REQUEST['target'] ) : '';
 924  	$scale       = ! empty( $_REQUEST['do'] ) && 'scale' === $_REQUEST['do'];
 925  
 926  	/** This filter is documented in wp-admin/includes/image-edit.php */
 927  	$edit_thumbnails_separately = (bool) apply_filters( 'image_edit_thumbnails_separately', false );
 928  
 929  	if ( $scale ) {
 930  		$size            = $img->get_size();
 931  		$original_width  = $size['width'];
 932  		$original_height = $size['height'];

PHP Documentation

<?php
/**
 * Saves image to post, along with enqueued changes
 * in `$_REQUEST['history']`.
 *
 * @since 2.9.0
 *
 * @param int $post_id Attachment post ID.
 * @return stdClass
 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-admin/includes/image-edit.php
Related Hooks

Related hooks will be displayed here in future updates.