forked from image-source-control/image-source-control
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.php
45 lines (40 loc) · 1.08 KB
/
functions.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
<?php
/**
* functions that can be directly used in the frontend
*/
/**
* echoes a list with image sources for a given post
*
* @global obj $my_isc isc class
* @param int $post_id post id
*/
function isc_list($post_id = 0) {
$isc_public = ISC_Class::get_instance();
echo $isc_public->list_post_attachments_with_sources($post_id);
}
/**
* returns the source html of a given image
*
* @global obj $my_isc isc class
* @param int $attachment_id id of the image
*/
function isc_image_source($attachment_id = 0) {
$isc_public = ISC_Class::get_instance();
echo $isc_public->render_image_source_string($attachment_id);
}
/**
* return the source html of the featured image
*
* @since 1.8
* @global obj $my_isc isc class
* @global obj $post current post
* @param int $post_id id of the post; will use current post if empty
*/
function isc_thumbnail_source($post_id = 0) {
global $post;
$isc_public = ISC_Class::get_instance();
if( empty($post_id) && isset($post->ID) ){
$post_id = $post->ID;
}
echo $isc_public->get_thumbnail_source_string($post_id);
}