Function To Add Subscribers Manually - Subscribe to Comments Reloaded

Note: This is for developers only.

As of version 200205 it is possible to add subscribers manually by calling a function.

That function is stcr_add_subscription . Below is an example of usage.

$data = [
    'post_id' => 99,
    'email'   => '',
    'type'    => 'all',
stcr_add_subscription( $data );

The following values are available for type :

  • all
  • all_unconfirmed
  • replies
  • replies_unconfirmed

If all_unconfirmed or replies_unconfirmed is used a confirmation email with a confirmation link will be sent to that email address.

Admin Email Notifications

If you have “Track all subscriptions” enabled in WP admin > StCR > Options the admin will receive an email for every subscription.

In case you do not want an email to be sent to the admin for these subscriptions, pass another parameter in the array called notify_admin and set it to false . Example below:

$data = [
    'post_id'      => 99,
    'email'        => '',
    'type'         => 'all',
    'notify_admin' => false,
stcr_add_subscription( $data );