PluginProbe
Image Source Control Lite – Show Image Credits and Captions / 1.10.4
Image Source Control Lite – Show Image Credits and Captions v1.10.4
3.12.0 3.11.0 trunk 1.1 1.1.1 1.1.2 1.1.2.1 1.1.3 1.10 1.10.1 1.10.2 1.10.3 1.10.4 1.10.5 1.2 1.2.0.1 1.2.0.2 1.2.0.3 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.4.1 1.3.5 All 110 releases
image-source-control-isc / functions.php

functions.php in Image Source Control Lite – Show Image Credits and Captions 1.10.4, at functions.php

46 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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