ap_get_subscriber( integer|false $user_id = false, string $event = '', integer $ref_id = '' )

Description #

Get a subscriber.

Parameters #

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

Changelog #

VersionDescription
4.2.0Fixed: warning Required parameter $event follows optional parameter $user_id.
4.1.5Introduced.

Source #

File: includes/subscribers.php

function ap_get_subscriber( $user_id = false, $event = '', $ref_id = '' ) {
	global $wpdb;

	if ( false === $user_id ) {
		$user_id = get_current_user_id();
	}

	if ( empty( $event ) || empty( $ref_id ) ) {
		return false;
	}

	$results = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->ap_subscribers WHERE subs_user_id = %d AND subs_ref_id = %d AND subs_event = %s LIMIT 1", $user_id, $ref_id, $event ) ); // phpcs:ignore WordPress.DB

	return $results;
}

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