예제 #1
0
 public function test_word_limiter()
 {
     $this->assertEquals('WordPress is web software...', Str::word_limiter('WordPress is web software you can use to create a beautiful website or blog.', 4));
     $this->assertEquals('WordPress is...', wpdevsclub_word_limiter('WordPress is web software you can use to create a beautiful website or blog.', 2));
 }
예제 #2
0
 /**
  * Limit the number of words in a string.
  *
  * @param  string  $value
  * @param  int     $limit
  * @param  string  $end
  * @return string
  */
 function wpdevsclub_word_limiter($value, $limit = 30, $end = '...')
 {
     return Str::word_limiter($value, $limit, $end);
 }