From 643ef730a73c400aa1e7cd7ff887712849ac0593 Mon Sep 17 00:00:00 2001 From: Kevin Fodness <2650828+kevinfodness@users.noreply.github.com> Date: Tue, 23 Jul 2024 10:08:32 -0400 Subject: [PATCH] Define WP_IMPORTING before bulk importing videos --- src/class-sync-manager.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/class-sync-manager.php b/src/class-sync-manager.php index 35ee1b8..1a87622 100644 --- a/src/class-sync-manager.php +++ b/src/class-sync-manager.php @@ -75,6 +75,8 @@ public function maybe_schedule_sync(): void { * @throws Error If unable to parse the last sync as a DateTimeImmutable object. */ public function sync_videos(): void { + define( 'WP_IMPORTING', true ); // phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedConstantFound + // If there isn't a valid adapter, bail. if ( ! $this->adapter instanceof Adapter ) { throw new Error( esc_html__( 'WP Video Sync: Unable to sync videos without a valid adapter.', 'wp-video-sync' ) );