Deprecated

This function has been deprecated.

ap_display_answer_metas( false|integer $answer_id = false )

Description #

Answer meta to display.

Parameters #

  • $answer_id
    false | integer (Optional) Answer id. Default value: false

Changelog #

VersionDescription
4.2.0This function has been deprecated.
2.0.1Introduced.

Source #

File: includes/theme.php

function ap_display_answer_metas( $answer_id = false ) {
	_deprecated_function( __FUNCTION__, '4.2.0' );
	return;

	// @codingStandardsIgnoreStart
	if ( false === $answer_id ) {
		$answer_id = get_the_ID();
	}

	$metas = array();
	if ( ap_is_selected( $answer_id ) ) {
		$metas['best_answer'] = '<span class="ap-best-answer-label">' . __( 'Best answer', 'anspress-question-answer' ) . '</span>';
	}

	$metas['history'] = ap_last_active_time( $answer_id );

	/**
	 * Used to filter answer display meta.
	 *
	 * @since 2.0.1
	 * @deprecated 4.2.0
	 */
	$metas = apply_filters( 'ap_display_answer_metas', $metas, $answer_id );

	$output = '';
	if ( ! empty( $metas ) && is_array( $metas ) ) {
		foreach ( $metas as $meta => $display ) {
			$output .= "<span class='ap-display-meta-item {$meta}'>{$display}</span>";
		}
	}

	return $output;
	// @codingStandardsIgnoreEnd
}

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