Build a custom follower signup UI
[benecaster_follower_signup] is the built-in form. When you want a popup overlay, a Gutenberg block, a custom landing page or a WP-CLI command instead, call benecaster_follower_signup() — it is the same code path, so you inherit user provisioning, the follower token row, the welcome email and both follower hooks without reimplementing any of them.
Branch on created — and Know What It Reports
But it reports whether a WordPress user was created, not whether a token was. Somebody who already had an account on your site but no token for this show gets a token and a welcome email while created stays false. That is a real signup returning false.
If your UI needs “are you already following this show?”, created will not answer it on its own: check whether benecaster_follower_signed_up fired, or ask the token repository.
Do Not Put Your Own “Email Taken” Check In Front Of This
A password passed for an address that already has an account is ignored, and the call still reports success. Both halves are deliberate. Applying the password would let anyone take over an existing account knowing only its email address. Returning an error instead would confirm that the address is registered, turning a public form into a way to test which of your listeners have accounts.
The recommendation follows from that: do not add your own “that email is taken” check, because it reintroduces the disclosure the function avoids. The WP_Error messages it returns are written to be non-enumerating and are safe to show the visitor unchanged.
Licensing
Follower signup is not licence-gated: this works identically on the free WordPress.org plugin and on any paid plan. The only limit is the 100-follower cap on an unlicensed install, enforced at signup: at 100 the form stops accepting new followers and shows the podcaster an upgrade prompt. Existing followers are unaffected, and no follower is ever demoted to the public feed.
Not for a List
Do not use this to enroll someone who is not at a keyboard. A donation webhook or an import must not convert an existing account’s relationship to the show, and this function sends an already following email to an address that already has a token — right for a public form, noise in an import. To add a list of people as followers, use bulk enrollment with token_type: 'follower' — see Import a follower list from code. FollowerSignup::signup_new_only() (the donation webhook’s own path) is still deliberately not exposed as a function.
To react to a signup from anywhere else, see React to a free follower signup.
Code
<?php
add_action( 'wp_ajax_nopriv_my_follow', 'my_addon_handle_follow' );
add_action( 'wp_ajax_my_follow', 'my_addon_handle_follow' );
function my_addon_handle_follow(): void {
check_ajax_referer( 'my_addon_follow' );
$result = benecaster_follower_signup(
absint( $_POST['show_id'] ?? 0 ),
sanitize_email( wp_unslash( $_POST['email'] ?? '' ) ),
sanitize_text_field( wp_unslash( $_POST['name'] ?? '' ) ),
'', // wall_name — set later from the account page
(string) ( $_POST['password'] ?? '' ) // ignored if the address already has an account
);
if ( is_wp_error( $result ) ) {
// Safe to show: the messages are deliberately non-enumerating.
wp_send_json_error( [ 'message' => $result->get_error_message() ], 400 );
}
wp_send_json_success( [
'message' => $result['created']
? __( 'Check your inbox for your private feed link.', 'my-addon' )
: __( "You're all set — we've sent your feed link again.", 'my-addon' ),
] );
}