| 1 |
<?php |
| 2 |
|
| 3 |
// phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong |
| 4 |
// phpcs:disable Yoast.NamingConventions.NamespaceName.MaxExceeded |
| 5 |
namespace Yoast\WP\SEO\Editors\Framework\Seo\Terms; |
| 6 |
|
| 7 |
use Yoast\WP\SEO\Editors\Domain\Seo\Description; |
| 8 |
use Yoast\WP\SEO\Editors\Domain\Seo\Seo_Plugin_Data_Interface; |
| 9 |
use Yoast\WP\SEO\Editors\Framework\Seo\Description_Data_Provider_Interface; |
| 10 |
|
| 11 |
/** |
| 12 |
* Describes if the description SEO data. |
| 13 |
*/ |
| 14 |
class Description_Data_Provider extends Abstract_Term_Seo_Data_Provider implements Description_Data_Provider_Interface { |
| 15 |
|
| 16 |
/** |
| 17 |
* Retrieves the description template. |
| 18 |
* |
| 19 |
* @return string The description template. |
| 20 |
*/ |
| 21 |
public function get_description_template(): string { |
| 22 |
return $this->get_template( 'metadesc' ); |
| 23 |
} |
| 24 |
|
| 25 |
/** |
| 26 |
* Determines the date to be displayed in the snippet preview. |
| 27 |
* |
| 28 |
* @return string |
| 29 |
*/ |
| 30 |
public function get_description_date(): string { |
| 31 |
return ''; |
| 32 |
} |
| 33 |
|
| 34 |
/** |
| 35 |
* Method to return the Description domain object with SEO data. |
| 36 |
* |
| 37 |
* @return Seo_Plugin_Data_Interface The specific seo data. |
| 38 |
*/ |
| 39 |
public function get_data(): Seo_Plugin_Data_Interface { |
| 40 |
return new Description( $this->get_description_date(), $this->get_description_template() ); |
| 41 |
} |
| 42 |
} |
| 43 |
|