image_editor_save_pre

image_editor_save_pre

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: wordpress-6.7

apply_filters('image_editor_save_pre') is found 2 times:

  • /wp-admin/includes/image-edit.php line 355
    		 *
    		 * @param WP_Image_Editor $image         The image editor instance.
    		 * @param int             $attachment_id The attachment post ID.
    		 */
    		$image = apply_filters( 'image_editor_save_pre', $image, $attachment_id );
    
    		if ( is_wp_error( $image->stream( $mime_type ) ) ) {
    			return false;
    		}
    
    		return true;
    
  • /wp-admin/includes/image-edit.php line 434
    function wp_save_image_file( $filename, $image, $mime_type, $post_id ) {
    	if ( $image instanceof WP_Image_Editor ) {
    
    		/** This filter is documented in wp-admin/includes/image-edit.php */
    		$image = apply_filters( 'image_editor_save_pre', $image, $post_id );
    
    		/**
    		 * Filters whether to skip saving the image file.
    		 *
    		 * Returning a non-null value will short-circuit the save method,
    		 * returning that value instead.