Skip to main content

BridgeWritable

\Benecaster\Bridge\BridgeWritable

Interface Premium

Additional interface a bridge must implement to appear as a valid destination in the Promote to Bridge wizard. A bridge implementing only BridgeInterface can read subscription state but cannot create new member records programmatically. Implementing BridgeWritable signals that the bridge can create members in its target plugin. Five built-in bridges implement this interface: MemberPressBridge, WooSubscriptionsBridge, PaidMembershipsBridge, and RestrictContentBridge.

Methods

Method Visibility Since Description
can_import(): bool Public Returns true when the bridge can create new member records programmatically. Returning false excludes the bridge from the Promote to Bridge target list even if BridgeWritable is implemented.
supports_tier( int $tier_id ): bool Public Returns true if the given tier ID exists in the target membership plugin and can receive new members. Used to validate the tier map before a wizard run executes.
create_member( string $email, int $user_id, int $tier_id, array $meta = [] ): bool Public Creates a member account in the target membership plugin. Returns true on success, false when the member already exists, and throws on unexpected errors.