Uses
Uses | Description |
---|---|
wp-includes/functions.php: wp_is_stream() | Test if a given path is a stream URL |
wp-includes/functions.php: wp_mkdir_p() | Recursive directory creation based on full path. |
Either calls editor’s save function or handles file as a stream.
(string|stream) (Required)
(callable) (Required)
(array) (Required)
(bool)
File: wp-includes/class-wp-image-editor.php
protected function make_image( $filename, $function, $arguments ) { $stream = wp_is_stream( $filename ); if ( $stream ) { ob_start(); } else { // The directory containing the original file may no longer exist when using a replication plugin. wp_mkdir_p( dirname( $filename ) ); } $result = call_user_func_array( $function, $arguments ); if ( $result && $stream ) { $contents = ob_get_contents(); $fp = fopen( $filename, 'w' ); if ( ! $fp ) { ob_end_clean(); return false; } fwrite( $fp, $contents ); fclose( $fp ); } if ( $stream ) { ob_end_clean(); } return $result; }
Version | Description |
---|---|
3.5.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_image_editor/make_image