Skip to content

Commit

Permalink
fix: check transient before distributed
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelpeixe committed Jan 22, 2025
1 parent f5a2416 commit 8f74264
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions includes/content-distribution/class-distributor-migrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 8f74264

Please sign in to comment.