diff --git a/wp-includes/class-wp-image-editor.php b/wp-includes/class-wp-image-editor.php index 099df1e0f3..7d76d66ecd 100644 --- a/wp-includes/class-wp-image-editor.php +++ b/wp-includes/class-wp-image-editor.php @@ -326,6 +326,9 @@ abstract class WP_Image_Editor { protected function make_image( $filename, $function, $arguments ) { $dst_file = $filename; + // The directory containing the original file may no longer exist when using a replication plugin. + wp_mkdir_p( dirname( $dst_file ) ); + if ( $stream = wp_is_stream( $filename ) ) { $filename = null; ob_start();