Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: wp_save_image_editor_file

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
344            *
345            * @since 3.5.0
346            *
347            * @param bool|null       $override  Value to return instead of saving. Default null.
348            * @param string          $filename  Name of the file to be saved.
349            * @param WP_Image_Editor $image     The image editor instance.
350            * @param string          $mime_type The mime type of the image.
351            * @param int             $post_id   Attachment post ID.
352            */
353           $saved = apply_filters( 'wp_save_image_editor_file', null, $filename, $image, $mime_type, $post_id );
354
355           if ( null !== $saved ) {
356                return $saved;
357           }
358
359           return $image->save( $filename, $mime_type );
360      } else {
361           /* translators: 1: $image, 2: WP_Image_Editor */
362           _deprecated_argument( __FUNCTION__, '3.5.0', sprintf( __( '%1$s needs to be a %2$s object.' ), '$image', 'WP_Image_Editor' ) );