-
Notifications
You must be signed in to change notification settings - Fork 0
/
class-07 (shortcodes).php
55 lines (39 loc) · 1.05 KB
/
class-07 (shortcodes).php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
/*
Plugin Name: Stock Toolkit
*/
//test shotcodes
/* function stock_alert_shortcode($atts, $content = null){
extract(shortcode_atts(
array(
'type' => 'success',
'type' => 'alert',
'type' => 'warning',
'type' => 'info'
//'text' => ''
),
$atts
));
//return '<div class="alert alert-'.esc_attr($type).'">'.esc_html($text).'</br>FIle is => '.__FILE__.'</div>';
// esc_html kscs use kora jai
return '<div class="alert alert-'.esc_attr($type).'">'.$content.'</br>FIle is => '.__FILE__.'</div>';
}
add_shortcode('alert','stock_alert_shortcode');
*/
function stock_alert_shortcode($atts, $content = null){
extract(shortcode_atts(
array(
'id' => '',
'size'=> 'large',
'size'=> 'thumbnail',
'size'=> 'medium'
),
$atts
));
//$img_array = wp_get_attachment_image_src($id, 'large');
$img_array = wp_get_attachment_image_src($id, $size);
var_dump($img_array);
return '<img src="'.$img_array[0].'"/>';
}
add_shortcode('image','stock_alert_shortcode');
?>