Astra_Ext_Blog_Pro_Markup::reading_time_content( string $content = '', string $loop_count = '', string $separator = '' )

Reading Time Meta.


Description


Parameters

$content

(string) (Optional) Post content.

Default value: ''

$loop_count

(string) (Optional) Post meta loop count.

Default value: ''

$separator

(string) (Optional) Separator text.

Default value: ''


Return

(string) content


Source

File: addons/blog-pro/classes/class-astra-ext-blog-pro-markup.php

		public function reading_time_content( $content = '', $loop_count = '', $separator = '' ) {
			$read_time                 = (int) $this->calculate_reading_time( get_the_ID() );
			$singular_min_reading_text = apply_filters( 'astra_post_minute_of_reading_text', __( 'minute of reading', 'astra-addon' ) );
			$plural_mins_reading_text  = apply_filters( 'astra_post_minutes_of_reading_text', __( 'minutes of reading', 'astra-addon' ) );

			$content .= ( 1 != $loop_count && '' != $content ) ? ' ' . $separator . ' ' : '';

			/* translators: %1$s: $read_time the time to read the article, %2%s: $singular_min_reading_text the singular minute reading time text, %3%s: $plural_mins_reading_text the plural minutes reading time text */
			$content .= '<span class="ast-reading-time">' . sprintf( _n( '%1$s %2$s', '%1$s %3$s', $read_time, 'astra-addon' ), $read_time, $singular_min_reading_text, $plural_mins_reading_text ) . '</span>'; // phpcs:ignore WordPress.WP.I18n.MismatchedPlaceholders

			return $content;
		}

Changelog

Changelog
Version Description
1.3.3 Updated post reading time strings.
1.0 Introduced.


User Contributed Notes

You must log in before being able to contribute a note or feedback.