# sharing-image/2.0/functions.php

Sharing Image, version 2.0. 36 lines.

- Page: https://pluginprobe.com/plugins/sharing-image/2.0/code/functions.php
- Raw: https://pluginprobe.com/plugins/sharing-image/2.0/raw/functions.php
- Modified: 2021-11-04T11:20:16+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/sharing-image/2.0/code/functions.php#L10-L20`.

```php
<?php
/**
 * Templates plugin functions
 *
 * @package sharing-image
 * @author  Anton Lukin
 */

if ( ! defined( 'ABSPATH' ) ) {
	die;
}

if ( ! function_exists( 'sharing_image_poster' ) ) {
	/**
	 * Public function to get Sharing Image poster url.
	 *
	 * @param int $object_id Optional. Post ID or Taxonomy term ID.
	 */
	function sharing_image_poster( $object_id = null ) {
		return ( new Sharing_Image\Meta() )->get_poster( $object_id );
	}
}


if ( ! function_exists( 'sharing_image_poster_src' ) ) {
	/**
	 * Public function to get Sharing Image poster data.
	 * Return image url, width and height.
	 *
	 * @param int $object_id Optional. Post ID or Taxonomy term ID.
	 */
	function sharing_image_poster_src( $object_id = null ) {
		return ( new Sharing_Image\Meta() )->get_poster_src( $object_id );
	}
}

```
