AnsPress_Notification_Hook::select_answer( object $_post )

Description #

Notify user when their answer is selected.

Parameters #

  • $_post
    object (Required) Post object.

Source #

File: addons/free/notification.php

	public static function select_answer( $_post ) {
		// Award select answer points to question author only.
		if ( get_current_user_id() !== $_post->post_author ) {
			ap_insert_notification( array(
				'user_id'  => $_post->post_author,
				'actor'    => get_current_user_id(),
				'parent'   => $_post->post_parent,
				'ref_id'   => $_post->ID,
				'ref_type' => 'answer',
				'verb'     => 'best_answer',
			) );
		}
	}

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