ap_is_user_subscriber( string $event, integer $ref_id, integer $user_id = false )

Description #

Check if user is subscribed to a reference event.

Parameters #

  • $event
    string (Required) Event type.
  • $ref_id
    integer (Required) Reference id.
  • $user_id
    integer (Optional) User ID. Default value: false

Source #

File: includes/subscribers.php

function ap_is_user_subscriber( $event, $ref_id, $user_id = false ) {
	if ( false === $user_id ) {
		$user_id = get_current_user_id();
	}

	$exists = ap_get_subscriber( $user_id, $event, $ref_id );

	if ( $exists ) {
		return true;
	}

	return false;
}

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Add your comment