| 1 |
<?php |
| 2 |
namespace AATXT\App; |
| 3 |
|
| 4 |
class AltTextGeneratorAttachmentTitle implements AltTextGeneratorInterface |
| 5 |
{ |
| 6 |
|
| 7 |
private function __construct() |
| 8 |
{ |
| 9 |
} |
| 10 |
|
| 11 |
/** |
| 12 |
* @return AltTextGeneratorAttachmentTitle |
| 13 |
*/ |
| 14 |
public static function make(): AltTextGeneratorAttachmentTitle |
| 15 |
{ |
| 16 |
return new self(); |
| 17 |
} |
| 18 |
|
| 19 |
/** |
| 20 |
* Get the alt text of the image |
| 21 |
* @param int $imageId |
| 22 |
* @return string |
| 23 |
*/ |
| 24 |
public function altText(int $imageId): string |
| 25 |
{ |
| 26 |
return get_the_title($imageId); |
| 27 |
} |
| 28 |
} |