Exemplo n.º 1
0
 public function test_slug()
 {
     $this->assertEquals('hello-world', Str::slug('hello world'));
     $this->assertEquals('hello-world', wpdevsclub_slug('Hello World'));
     $this->assertEquals('hello-world', Str::slug('hello-world'));
     $this->assertEquals('hello-world', wpdevsclub_slug('hello_world'));
     $this->assertEquals('hello_world', Str::slug('hello_world', '_'));
 }
Exemplo n.º 2
0
 /**
  * Generate a URL friendly "slug" from a given string.
  *
  * @param  string  $title
  * @param  string  $separator
  * @return string
  */
 function wpdevsclub_slug($title, $separator = '-')
 {
     return Str::slug($title, $separator);
 }