Deprecated

This method has been deprecated.

AnsPress_Hooks::human_time_diff( string $since )

Description #

Make human_time_diff strings translatable.

Parameters #

  • $since
    string (Required) Time since.

Changelog #

VersionDescription
4.1.13This method has been deprecated.
2.4.8Introduced.

Source #

File: includes/hooks.php

	public static function human_time_diff( $since ) {
		$replace = array(
			'min'   => __( 'minute', 'anspress-question-answer' ),
			'mins'  => __( 'minutes', 'anspress-question-answer' ),
			'hour'  => __( 'hour', 'anspress-question-answer' ),
			'hours' => __( 'hours', 'anspress-question-answer' ),
			'day'   => __( 'day', 'anspress-question-answer' ),
			'days'  => __( 'days', 'anspress-question-answer' ),
			'week'  => __( 'week', 'anspress-question-answer' ),
			'weeks' => __( 'weeks', 'anspress-question-answer' ),
			'year'  => __( 'year', 'anspress-question-answer' ),
			'years' => __( 'years', 'anspress-question-answer' ),
		);

		return strtr( $since, $replace );
	}

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