BuddyPress::new_comment_notification( object $comment )

Description #

New comment notification.

Parameters #

  • $comment
    object (Required) Comment object.

Source #

File: addons/buddypress/buddypress.php

	public function new_comment_notification( $comment ) {
		if ( ! bp_is_active( 'notifications' ) ) {
			return;
		}

		global $bp;

		$comment = (object) $comment;
		$post    = get_post( $comment->comment_post_ID );

		bp_notifications_add_notification(
			array(
				'user_id'          => $post->post_author,
				'item_id'          => $comment->comment_ID,
				'component_name'   => 'anspress',
				'component_action' => 'new_comment',
				'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