From e3d29ee8cb3b314bc6b068bd67dd06a752beb2cb Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Sun, 20 Nov 2022 21:19:08 +0100 Subject: Set thumbnail size before migrating images. --- import-posts.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/import-posts.php b/import-posts.php index 113d356..70aa7a4 100644 --- a/import-posts.php +++ b/import-posts.php @@ -29,6 +29,10 @@ require_once getcwd() . '/wp-admin/includes/taxonomy.php'; // Required for kses functionality require_once getcwd() . '/wp-includes/kses.php'; +// Import media handling to get post thumbnails to work +require_once getcwd() . '/wp-includes/media.php'; + +set_post_thumbnail_size( 500, 300, true ); $archive = new ZipArchive(); if ( true === $archive->open( $filename, ZipArchive::RDONLY ) ) { -- cgit v1.2.3