AnsPress_Hooks::new_subscriber( $subscribe_id, integer $user_id, string $event, integer $ref_id )
Description #
Update qameta subscribers count on adding new subscriber.
Parameters #
- $subscriber_idinteger (Required) id of new subscriber added.
- $user_idinteger (Required) id of user.
- $eventstring (Required) Subscribe event.
- $ref_idinteger (Required) Reference id.
Source #
File: includes/hooks.php
public static function new_subscriber( $subscribe_id, $user_id, $event, $ref_id ) { // Remove ids from event. $esc_event = ap_esc_subscriber_event( $event ); if ( in_array( $esc_event, [ 'question', 'answer', 'comment' ], true ) ) { ap_update_subscribers_count( $ref_id ); } // Update answer subscribers count. if ( 'answer' === $esc_event ) { $event_id = ap_esc_subscriber_event_id( $event ); ap_update_subscribers_count( $event_id ); } }
Expand full source code Collapse full source code View on GitHub: includes/hooks.php:953
Add your comment