| 1 |
<?php |
| 2 |
/** |
| 3 |
* Templates plugin functions |
| 4 |
* |
| 5 |
* @package sharing-image |
| 6 |
* @author Anton Lukin |
| 7 |
*/ |
| 8 |
|
| 9 |
if ( ! defined( 'ABSPATH' ) ) { |
| 10 |
die; |
| 11 |
} |
| 12 |
|
| 13 |
if ( ! function_exists( 'sharing_image_poster' ) ) { |
| 14 |
/** |
| 15 |
* Public function to get Sharing Image poster url. |
| 16 |
* |
| 17 |
* @param int $object_id Optional. Post ID or Taxonomy term ID. |
| 18 |
*/ |
| 19 |
function sharing_image_poster( $object_id = null ) { |
| 20 |
return ( new Sharing_Image\Meta() )->get_poster( $object_id ); |
| 21 |
} |
| 22 |
} |
| 23 |
|
| 24 |
|
| 25 |
if ( ! function_exists( 'sharing_image_poster_src' ) ) { |
| 26 |
/** |
| 27 |
* Public function to get Sharing Image poster data. |
| 28 |
* Return image url, width and height. |
| 29 |
* |
| 30 |
* @param int $object_id Optional. Post ID or Taxonomy term ID. |
| 31 |
*/ |
| 32 |
function sharing_image_poster_src( $object_id = null ) { |
| 33 |
return ( new Sharing_Image\Meta() )->get_poster_src( $object_id ); |
| 34 |
} |
| 35 |
} |
| 36 |
|