addShortcode() 공개 정적인 메소드

Add a shortcode handler
public static addShortcode ( string $tag, function $function )
$tag string the shortcode tag
$function function the shortcode handling function
예제 #1
0
파일: PostTest.php 프로젝트: jgrossi/corcel
 public function testAddShortcode()
 {
     Post::addShortcode('gallery', function (ShortcodeInterface $s) {
         return $s->getName() . '.' . $s->getParameter('id') . '.' . $s->getParameter('size');
     });
     $post = Post::find(123);
     $this->assertEquals($post->content, 'test gallery.123.medium shortcodes');
 }