Exemple #1
0
 /**
  * Register the shortcode using WP's add_shortcode function
  *
  * @param string $fullpath /full/path/to/file.php
  * @param string $ext file extension. This is stripped to calculate the shortcode
  * @return void
  */
 public static function add_shortcode($fullpath, $ext)
 {
     $tag = self::get_shortname($fullpath, $ext);
     Snippet::map($tag, $fullpath);
     // success
     add_shortcode($tag, 'Phpsnippets\\Snippet::' . $tag);
 }