BuddyPress::question_answer_tracking()

Description #

Set tracking arguments for question and answer post type.

Source #

File: addons/buddypress/buddypress.php

	public function question_answer_tracking() {
		// Check if the Activity component is active before using it.
		if ( ! function_exists( 'bp_is_active' ) || ! bp_is_active( 'activity' ) ) {
			return;
		}

		bp_activity_set_post_type_tracking_args(
			'question',
			array(
				'component_id'                      => 'activity',
				'action_id'                         => 'new_question',
				'contexts'                          => array( 'activity', 'member' ),
				'bp_activity_admin_filter'          => __( 'Question', 'anspress-question-answer' ),
				'bp_activity_front_filter'          => __( 'Question', 'anspress-question-answer' ),
				// translators: First placeholder contains user link and name.
				'bp_activity_new_post'              => __( '%1$s asked a new <a href="AP_CPT_LINK">question</a>', 'anspress-question-answer' ),
				// translators: First placeholder contains user link and name.
				'bp_activity_new_post_ms'           => __( '%1$s asked a new <a href="AP_CPT_LINK">question</a>, on the site %3$s', 'anspress-question-answer' ),
				'activity_comment'                  => true,
				'comment_action_id'                 => 'new_comment_question',
				'bp_activity_comments_admin_filter' => __( 'Commented on Question', 'anspress-question-answer' ),
				'bp_activity_comments_front_filter' => __( 'Commented on Question', 'anspress-question-answer' ),
				// translators: First placeholder contains user link and name.
				'bp_activity_new_comment'           => __( '%1$s commented on <a href="%2$s">question</a>', 'anspress-question-answer' ),
				// translators: First placeholder contains user link and name.
				'bp_activity_new_comment_ms'        => __( '%1$s commented on <a href="%2$s">question</a>, on the site %3$s', 'anspress-question-answer' ),
			)
		);

		bp_activity_set_post_type_tracking_args(
			'answer',
			array(
				'component_id'                      => 'activity',
				'action_id'                         => 'new_answer',
				'contexts'                          => array( 'activity', 'member' ),
				'bp_activity_admin_filter'          => __( 'Answer', 'anspress-question-answer' ),
				'bp_activity_front_filter'          => __( 'Answer', 'anspress-question-answer' ),
				// translators: First placeholder contains user name and link.
				'bp_activity_new_post'              => __( '%1$s <a href="AP_CPT_LINK">answered</a> a question', 'anspress-question-answer' ),
				// translators: First placeholder contains user name and link.
				'bp_activity_new_post_ms'           => __( '%1$s <a href="AP_CPT_LINK">answered</a> a question, on the site %3$s', 'anspress-question-answer' ),
				'activity_comment'                  => true,
				'comment_action_id'                 => 'new_comment_answer',
				'bp_activity_comments_admin_filter' => __( 'Commented on Answer', 'anspress-question-answer' ),
				'bp_activity_comments_front_filter' => __( 'Commented on Answer', 'anspress-question-answer' ),
				// translators: First placeholder contains user link and name.
				'bp_activity_new_comment'           => __( '%1$s commented on <a href="%2$s">answer</a>', 'anspress-question-answer' ),
				// translators: First placeholder contains user link and name.
				'bp_activity_new_comment_ms'        => __( '%1$s commented on <a href="%2$s">answer</a>, on the site %3$s', 'anspress-question-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