get_noptin_subscribers_count( $where = '',  $meta_key = '',  $meta_value = false )

Retrieves the subscriber count


Return Return

(int) $where Restriction string


Top ↑

Source Source

File: includes/subscriber.php

function get_noptin_subscribers_count( $where = '', $meta_key = '', $meta_value = false ) {
	global $wpdb;

	$table      = get_noptin_subscribers_table_name();
	$meta_table = get_noptin_subscribers_meta_table_name();
	$extra_sql  = '';

	if ( false !== $meta_value ) {
		$extra_sql = "INNER JOIN $meta_table ON ( $table.id = $meta_table.noptin_subscriber_id ) WHERE ( $meta_table.meta_key = '%s' AND $meta_table.meta_value = '%s' )";
		$extra_sql = $wpdb->prepare( $extra_sql, $meta_key, $meta_value );
	}

	if ( ! empty( $where ) ) {

		if ( empty( $extra_sql ) ) {
			$where = "WHERE $where";
		} else {
			$where = "$extra_sql AND $where";
		}
	} else {
		$where = "$extra_sql";
	}

	return $wpdb->get_var( "SELECT COUNT(`id`) FROM $table $where;" );
}


Top ↑

Changelog Changelog

Changelog
VersionDescription
1.0.5Introduced.

Top ↑

User Contributed Notes User Contributed Notes

30 day money back guarantee
Safe & Secure online payment
Custom CSS Slide Example
Custom Animation Example
Default Animation