From 4b032e0bffefe4f8e35e327c6690eb3c246f5898 Mon Sep 17 00:00:00 2001 From: aledesma-godaddy Date: Thu, 25 Jul 2024 11:46:34 -0700 Subject: [PATCH] introduce bail check when missing DOMDocument --- includes/block-migrate/loader.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/includes/block-migrate/loader.php b/includes/block-migrate/loader.php index ad5d4d6b1b6..d783bce4e97 100644 --- a/includes/block-migrate/loader.php +++ b/includes/block-migrate/loader.php @@ -35,6 +35,11 @@ function( WP_Post &$post ) { return; } + // Bail if DOMDocument is not available. + if ( ! class_exists( 'DOMDocument' ) ) { + return; + } + // Parse the blocks so we can search them in a standard way. $parsed_blocks = parse_blocks( $post->post_content );