| 1 |
<?php |
| 2 |
/** |
| 3 |
* functions that can be directly used in the frontend |
| 4 |
*/ |
| 5 |
|
| 6 |
/** |
| 7 |
* echoes a list with image sources for a given post |
| 8 |
* |
| 9 |
* @global obj $my_isc isc class |
| 10 |
* @param int $post_id post id |
| 11 |
*/ |
| 12 |
function isc_list($post_id = 0) { |
| 13 |
$isc_public = ISC_Class::get_instance(); |
| 14 |
echo $isc_public->list_post_attachments_with_sources($post_id); |
| 15 |
} |
| 16 |
|
| 17 |
/** |
| 18 |
* returns the source html of a given image |
| 19 |
* |
| 20 |
* @global obj $my_isc isc class |
| 21 |
* @param int $attachment_id id of the image |
| 22 |
*/ |
| 23 |
function isc_image_source($attachment_id = 0) { |
| 24 |
$isc_public = ISC_Class::get_instance(); |
| 25 |
echo $isc_public->render_image_source_string($attachment_id); |
| 26 |
} |
| 27 |
|
| 28 |
/** |
| 29 |
* return the source html of the featured image |
| 30 |
* |
| 31 |
* @since 1.8 |
| 32 |
* @global obj $my_isc isc class |
| 33 |
* @global obj $post current post |
| 34 |
* @param int $post_id id of the post; will use current post if empty |
| 35 |
*/ |
| 36 |
function isc_thumbnail_source($post_id = 0) { |
| 37 |
global $post; |
| 38 |
$isc_public = ISC_Class::get_instance(); |
| 39 |
|
| 40 |
if( empty($post_id) && isset($post->ID) ){ |
| 41 |
$post_id = $post->ID; |
| 42 |
} |
| 43 |
|
| 44 |
echo $isc_public->get_thumbnail_source_string($post_id); |
| 45 |
} |
| 46 |
|