then( spreadArgs( Fns::withoutRecursion( Fns::noop(), [ self::class, 'syncAttachedFile' ] ) ) ); } public static function syncAttachedFile( $meta_id, $object_id, $meta_key, $meta_value ) { if ( $meta_key === '_wp_attached_file' ) { $prevValue = Post::getMetaSingle( $object_id, $meta_key ); // $isMetaSameAsPrevious :: id → bool $isMetaSameAsPrevious = pipe( Post::getMetaSingle( Fns::__, $meta_key ), Relation::equals( $prevValue ) ); IfOriginalPost::getTranslationIds( $object_id ) ->filter( Fns::unary( $isMetaSameAsPrevious ) ) ->each( Fns::unary( Post::updateMeta( Fns::__, $meta_key, $meta_value ) ) ); } } }