ap_activity_short_title( string $type )

Description #

Activity type to human readable title.

Parameters #

  • $type
    string (Required) Activity type.

Source #

File: includes/functions.php

function ap_activity_short_title( $type ) {
	$title = array(
		'new_question'           => __( 'asked', 'anspress-question-answer' ),
		'approved_question'      => __( 'approved', 'anspress-question-answer' ),
		'approved_answer'        => __( 'approved', 'anspress-question-answer' ),
		'new_answer'             => __( 'answered', 'anspress-question-answer' ),
		'delete_answer'          => __( 'deleted answer', 'anspress-question-answer' ),
		'restore_question'       => __( 'restored question', 'anspress-question-answer' ),
		'restore_answer'         => __( 'restored answer', 'anspress-question-answer' ),
		'new_comment'            => __( 'commented', 'anspress-question-answer' ),
		'delete_comment'         => __( 'deleted comment', 'anspress-question-answer' ),
		'new_comment_answer'     => __( 'commented on answer', 'anspress-question-answer' ),
		'edit_question'          => __( 'edited question', 'anspress-question-answer' ),
		'edit_answer'            => __( 'edited answer', 'anspress-question-answer' ),
		'edit_comment'           => __( 'edited comment', 'anspress-question-answer' ),
		'edit_comment_answer'    => __( 'edited comment on answer', 'anspress-question-answer' ),
		'answer_selected'        => __( 'selected answer', 'anspress-question-answer' ),
		'answer_unselected'      => __( 'unselected answer', 'anspress-question-answer' ),
		'status_updated'         => __( 'updated status', 'anspress-question-answer' ),
		'best_answer'            => __( 'selected as best answer', 'anspress-question-answer' ),
		'unselected_best_answer' => __( 'unselected as best answer', 'anspress-question-answer' ),
		'changed_status'         => __( 'changed status', 'anspress-question-answer' ),
	);

	$title = apply_filters( 'ap_activity_short_title', $title );

	if ( isset( $title[ $type ] ) ) {
		return $title[ $type ];
	}

	return $type;
}

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