| 1 |
<?php |
| 2 |
|
| 3 |
if(!function_exists('get_thumb_image_src')){ |
| 4 |
function get_thumb_image_src($att_id = '', $type = ''){ |
| 5 |
if($att_id == '' or $type == '' ) |
| 6 |
return false; |
| 7 |
|
| 8 |
$full_image = wp_get_attachment_image_src( $att_id, $type ); |
| 9 |
if(is_array($full_image)){ |
| 10 |
return $full_image[0]; |
| 11 |
} else { |
| 12 |
return false; |
| 13 |
} |
| 14 |
} |
| 15 |
} |
| 16 |
|
| 17 |
if(!function_exists('get_thumb_image')){ |
| 18 |
function get_thumb_image($att_id = '', $type = ''){ |
| 19 |
if($att_id == '' or $type == '' ) |
| 20 |
return false; |
| 21 |
|
| 22 |
$full_image = wp_get_attachment_image_src( $att_id, $type ); |
| 23 |
if(is_array($full_image)){ |
| 24 |
return '<img src="'.$full_image[0].'" alt="'.$type.'">'; |
| 25 |
} else { |
| 26 |
return false; |
| 27 |
} |
| 28 |
} |
| 29 |
} |
| 30 |
|
| 31 |
if(!function_exists('get_thumb_image_sc')){ |
| 32 |
function get_thumb_image_sc( $atts ) { |
| 33 |
$a = shortcode_atts( array( |
| 34 |
'att_id' => '', |
| 35 |
'type' => '', |
| 36 |
), $atts ); |
| 37 |
return get_thumb_image($a['att_id'], $a['type']); |
| 38 |
} |
| 39 |
} |
| 40 |
|
| 41 |
if(!function_exists('get_thumb_image_src_sc')){ |
| 42 |
function get_thumb_image_src_sc( $atts ) { |
| 43 |
$a = shortcode_atts( array( |
| 44 |
'att_id' => '', |
| 45 |
'type' => '', |
| 46 |
), $atts ); |
| 47 |
return get_thumb_image_src($a['att_id'], $a['type']); |
| 48 |
} |
| 49 |
} |
| 50 |
|
| 51 |
if(!function_exists('thumb_editor_afo_text_domain')){ |
| 52 |
function thumb_editor_afo_text_domain(){ |
| 53 |
load_plugin_textdomain('thumbnail-editor', FALSE, basename( THE_PLUGIN_PATH ) .'/languages'); |
| 54 |
} |
| 55 |
} |