From 8f74264d5c109409d52271b03b4bbd176a46cde3 Mon Sep 17 00:00:00 2001 From: Miguel Peixe Date: Wed, 22 Jan 2025 18:52:58 -0300 Subject: [PATCH] fix: check transient before distributed --- .../content-distribution/class-distributor-migrator.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/content-distribution/class-distributor-migrator.php b/includes/content-distribution/class-distributor-migrator.php index 4590109..4f71d95 100644 --- a/includes/content-distribution/class-distributor-migrator.php +++ b/includes/content-distribution/class-distributor-migrator.php @@ -55,13 +55,13 @@ public static function filter_migration_lock_cap( $caps, $cap, $user_id, $args ) return $caps; } - $post_id = $args[0]; - if ( ! Content_Distribution::is_post_distributed( $post_id ) ) { + $locked = get_transient( self::MIGRATION_LOCK_TRANSIENT_NAME ); + if ( ! $locked ) { return $caps; } - $locked = get_transient( self::MIGRATION_LOCK_TRANSIENT_NAME ); - if ( ! $locked ) { + $post_id = $args[0]; + if ( ! Content_Distribution::is_post_distributed( $post_id ) ) { return $caps; }