ap_question_title_with_solved_prefix( boolean|integer $question_id = false )

Description #

Return question title with solved prefix if answer is accepted.

Parameters #

  • $question_id
    boolean | integer (Optional) Question ID. Default value: false

Changelog #

VersionDescription
2.3Introduced.

Source #

File: includes/functions.php

function ap_question_title_with_solved_prefix( $question_id = false ) {
	if ( false === $question_id ) {
		$question_id = get_question_id();
	}

	$solved = ap_have_answer_selected( $question_id );

	if ( ap_opt( 'show_solved_prefix' ) ) {
		return ( $solved ? __( '[Solved] ', 'anspress-question-answer' ) : '' ) . get_the_title( $question_id ) . ' ';
	}

	return get_the_title( $question_id );
}

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