BuddyPress::new_answer_notification( integer $post_id )

Description #

New answer notifications.

Parameters #

  • $post_id
    integer (Required) Post ID.

Source #

File: addons/buddypress/buddypress.php

	public function new_answer_notification( $post_id ) {
		if ( ! bp_is_active( 'notifications' ) ) {
			return;
		}

		$post     = get_post( $post_id );
		$question = get_post( $post->post_parent );

		bp_notifications_add_notification(
			array(
				'user_id'           => $question->post_author,
				'item_id'           => $post->ID,
				'secondary_item_id' => $post->post_author,
				'component_name'    => 'anspress',
				'component_action'  => 'new_answer',
				'date_notified'     => bp_core_current_time(),
				'is_new'            => 1,
			)
		);
	}

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