ap_subscribers_count( string $event = '', integer $ref_id )
Description #
Get a subscribers count of a reference by specific event or without it.
Parameters #
- $eventstring (Optional) Event type. Default value: ''
- $ref_idinteger (Required) Reference identifier id.
Source #
File: includes/subscribers.php
function ap_subscribers_count( $event = '', $ref_id = 0 ) { global $wpdb; $ref_query = ''; if ( $ref_id > 0 ) { $ref_query = $wpdb->prepare( ' AND subs_ref_id = %d', $ref_id ); } $event_query = ''; if ( ! empty( $event ) ) { $event_query = $wpdb->prepare( ' AND subs_event = %s', $event ); } $results = $wpdb->get_var( "SELECT count(*) FROM {$wpdb->ap_subscribers} WHERE 1=1 {$event_query} {$ref_query}" ); //phpcs:ignore WordPress.DB return $results; }
Expand full source code Collapse full source code View on GitHub: includes/subscribers.php:112
Add your comment