示例#1
0
function be_video($atts, $content)
{
    extract(shortcode_atts(array('source' => 'youtube', 'url' => ''), $atts));
    switch ($source) {
        case 'youtube':
            return be_youtube($url);
            break;
        default:
            return be_vimeo($url);
            break;
    }
}
示例#2
0
 function be_video($atts, $content)
 {
     extract(shortcode_atts(array('source' => 'youtube', 'url' => '', 'animate' => 0, 'animation_type' => 'fadeIn'), $atts));
     $output = '';
     switch ($source) {
         case 'youtube':
             $output .= isset($animate) && 1 == $animate ? '<div class="be-animate" data-animation="' . $animation_type . '">' : '';
             $output .= be_youtube($url);
             $output .= isset($animate) && 1 == $animate ? '</div>' : '';
             return $output;
             break;
         default:
             $output .= isset($animate) && 1 == $animate ? '<div class="be-animate" data-animation="' . $animation_type . '">' : '';
             $output .= be_vimeo($url);
             $output .= isset($animate) && 1 == $animate ? '</div>' : '';
             return $output;
             break;
     }
 }