PluginProbe
Gallery Box / trunk
Gallery Box vtrunk
trunk 1.3.1 1.3.3 1.4.0 1.4.1 1.4.2 1.5.1 1.7.35
gallery-box / includes / other-shortcode.php

other-shortcode.php in Gallery Box trunk, at includes/other-shortcode.php

41 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /*
3 *
4 * Other shortcode for Gallery Box
5 *
6 *
7 */
8
9 //single Youtube video shortcode
10 if ( ! function_exists( 'n_single_youtube_gbox' ) ) :
11 function n_single_youtube_gbox( $atts, $content = null ) {
12 $g_youtube = shortcode_atts( array(
13 'id' => 'CXkl1FgeM7M',
14 'height' => 300,
15 'width' => 800,
16 'caption' => __('simple Youtube video','gallery-box')
17
18 ), $atts );
19 $youtube_url='//youtu.be/'.$g_youtube['id'];
20 $youtube_img_url='//img.youtube.com/vi/'.$g_youtube['id'].'/0.jpg';
21 return '<div class="gallery-box"><a class="gclick" href="'.esc_url($youtube_url).'" data-poptrox="youtube,'.esc_attr($g_youtube['width']).'x'.esc_attr($g_youtube['height']).'"><img src="'.esc_url($youtube_img_url).'" width="'.esc_attr($g_youtube['width']).'" height="'.esc_attr($g_youtube['height']).'" alt="'.esc_attr($g_youtube['caption']).'" title="'.esc_attr($g_youtube['caption']).'" /></a></div>';
22 }
23 add_shortcode('gbox_youtube','n_single_youtube_gbox');
24 endif;
25
26 //single Vimeo video shortcode
27 if ( ! function_exists( 'n_single_vimeo_gbox' ) ) :
28 function n_single_vimeo_gbox( $atts, $content = null ) {
29 $g_vimeo = shortcode_atts( array(
30 'id' => '121840700',
31 'height' => 400,
32 'width' => 800,
33 'caption' => __('simple Vimeo video','gallery-box')
34 ), $atts );
35 $vimeo_url='//vimeo.com/'.$g_vimeo['id'];
36 $vimeo_img_url='//i.vimeocdn.com/video/'.$g_vimeo['id'].'_640.jpg';
37 return '<div class="gallery-box"><a class="gclick" href="'.esc_url($vimeo_url).'" data-poptrox="vimeo,'.esc_attr($g_vimeo['width']).'x'.esc_attr($g_vimeo['height']).'"><img src="'.esc_url($vimeo_img_url).'" width="'.esc_attr($g_vimeo['width']).'" height="'.esc_attr($g_vimeo['height']).'" alt="'.esc_attr($g_vimeo['caption']).'" title="'.esc_attr($g_vimeo['caption']).'" /></a></div>';
38 }
39 add_shortcode('gbox_vimeo','n_single_vimeo_gbox');
40 endif;
41