wp_save_image_file


wp_save_image_file ( $filename, $image, $mime_type, $post_id )

Parameters:
  • (string) filename Name of the file to be saved.
  • (WP_Image_Editor) image The image editor instance.
  • (string) mime_type The mime type of the image.
  • (int) post_id Attachment post ID.
Returns:
  • (array|WP_Error|bool) { Array on success or WP_Error if the file failed to save. When called with a deprecated value for the `$image` parameter, i.e. a non-`WP_Image_Editor` image resource or `GdImage` instance, the function will return true on success, false on failure. @type string $path Path to the image file. @type string $file Name of the image file. @type int $width Image width. @type int $height Image height. @type string $mime-type The mime type of the image. @type int $filesize File size of the image. }
Defined at:
Change Log:
  • 3: .
  • 6: .

Description

Saves image to file.

Related Functions

wp_save_image, wp_get_image_mime, _copy_image_file, wp_calculate_image_sizes, wp_stream_image

Top Google Results

User discussions

wpseek mobile