From 3f836232d30c84eed60d2b994a215b07697c6729 Mon Sep 17 00:00:00 2001 From: Bero Date: Fri, 3 May 2024 06:54:21 +0200 Subject: [PATCH] Support wp_crop_image in import wxr (#1357) ## What is this PR doing? It adds support for wp_crop_image in the importWXR step. ## What problem is it solving? It allows cropping images during WXR imports. ## How is the problem addressed? By requiring `/wp-admin/includes/image.php` if `wp_crop_image` doesn't exist ## Testing Instructions - Checkout this branch - [Open this blueprint](http://127.0.0.1:5400/website-server/?blueprint-url=https://raw.githubusercontent.com/wptrainingteam/tt4-book-reviews/master/_playground/blueprint.json) - Confirm that there are no PHP errors and that new posts are imported with images ![image](https://github.com/WordPress/wordpress-playground/assets/1199991/02f14faa-bbf0-4c41-87cc-434ae0340ad2) --- packages/playground/blueprints/src/lib/steps/import-wxr.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/playground/blueprints/src/lib/steps/import-wxr.ts b/packages/playground/blueprints/src/lib/steps/import-wxr.ts index dc1de5ee5d..c3d6011f9b 100644 --- a/packages/playground/blueprints/src/lib/steps/import-wxr.ts +++ b/packages/playground/blueprints/src/lib/steps/import-wxr.ts @@ -42,6 +42,9 @@ export const importWxr: StepHandler> = async ( await playground.run({ code: ` 'Administrator') )[0]; $importer = new WXR_Importer( array(