| 1 |
<?php |
| 2 |
namespace epiphyt\Embed_Privacy\thumbnail\provider; |
| 3 |
|
| 4 |
/** |
| 5 |
* Thumbnail provider interface. |
| 6 |
*/ |
| 7 |
interface Thumbnail_Provider_Interface { |
| 8 |
/** |
| 9 |
* Get the thumbnail from a source string. |
| 10 |
* |
| 11 |
* @param object $data A data object result from an oEmbed provider |
| 12 |
* @param string $url The URL of the content to be embedded |
| 13 |
*/ |
| 14 |
public static function get( $data, $url ); |
| 15 |
|
| 16 |
/** |
| 17 |
* Get the thumbnail ID from an embed content. |
| 18 |
* |
| 19 |
* @param string $content Embed content/URL to get the thumbnail ID from |
| 20 |
* @return string Thumbnail ID |
| 21 |
*/ |
| 22 |
public static function get_id( $content ); |
| 23 |
|
| 24 |
/** |
| 25 |
* Get a thumbnail path. |
| 26 |
* |
| 27 |
* @param string $filename Thumbnail filename |
| 28 |
* @return string Absolute thumbnail path |
| 29 |
*/ |
| 30 |
public static function get_path( $filename ); |
| 31 |
|
| 32 |
/** |
| 33 |
* Get the thumbnail provider title. |
| 34 |
* |
| 35 |
* @return string Thumbnail provider title |
| 36 |
*/ |
| 37 |
public static function get_title(); |
| 38 |
|
| 39 |
/** |
| 40 |
* Get a thumbnail URL. |
| 41 |
* |
| 42 |
* @param string $filename Thumbnail filename |
| 43 |
* @return string Thumbnail URL |
| 44 |
*/ |
| 45 |
public static function get_url( $filename ); |
| 46 |
|
| 47 |
/** |
| 48 |
* Check whether the given URL is from this provider. |
| 49 |
* |
| 50 |
* @param string $url The URL of the content to be embedded |
| 51 |
* @return bool Whether the given URL is from this provider |
| 52 |
*/ |
| 53 |
public static function is_provider_embed( $url ); |
| 54 |
|
| 55 |
/** |
| 56 |
* Download and save a thumbnail. |
| 57 |
* |
| 58 |
* @param string $id Embed ID |
| 59 |
* @param string $url Embed URL |
| 60 |
* @param string $thumbnail_url Optional thumbnail URL if already available |
| 61 |
*/ |
| 62 |
public static function save( $id, $url, $thumbnail_url = '' ); |
| 63 |
} |
| 64 |
|