コード例 #1
0
 function widget($args, $instance)
 {
     global $videogall_options;
     extract($args, EXTR_SKIP);
     $instance = $this->widget_enforce_defaults($instance);
     extract($instance, EXTR_SKIP);
     $unique_id = $args['widget_id'];
     echo $before_widget;
     if ($title) {
         echo $before_title . apply_filters('widget_title', $title, $instance, $this->id_base) . $after_title;
     } else {
         echo '';
     }
     echo videogall_display_videos($category, true, $number_of_videos);
     echo $after_widget;
 }
コード例 #2
0
ファイル: videogall.php プロジェクト: rodsilver83/victoria
/**
 * Filter Shortcode
 */
function videogall_filter($content)
{
    preg_match_all('/\\[myvideogall:(.*)\\]/', $content, $matches);
    for ($i = 0; $i < count($matches[0]); $i++) {
        $shortcodestr = explode(":", $matches[0][$i]);
        $category = str_replace(']', '', $shortcodestr[1]);
        if (preg_match('/all/i', $category)) {
            $filter = '';
        } else {
            $filter = $category;
        }
        $content = str_ireplace("[myvideogall:{$category}]", videogall_display_videos($filter), $content);
    }
    return $content;
}