Browse Source

If time less than 1 minute to remove _nx function error it assume less than 1 number plural i explicitly set time to 1 it time less than 1.

sharaz 6 years ago
parent
commit
88a4274edf
1 changed files with 4 additions and 0 deletions
  1. 4 0
      independent-publisher-2/functions.php

+ 4 - 0
independent-publisher-2/functions.php

@@ -129,6 +129,10 @@ function independent_publisher_2_word_count() {
 	$content = get_post_field( 'post_content', get_the_ID() );
 	$count   = str_word_count( strip_tags( $content ) );
 	$time    = $count / 250; //Roughly 250 wpm reading time
+	// if time less than 1 explicitly set to 1.
+	if( $time < 1 ) {
+		$time = 1;
+	}
 	return number_format( $time );
 }
 endif; // independent_publisher_2_word_count