| 1 |
<?php |
| 2 |
/** |
| 3 |
* WPSEO plugin file. |
| 4 |
* |
| 5 |
* @package WPSEO\Frontend\Schema |
| 6 |
*/ |
| 7 |
|
| 8 |
use Yoast\WP\SEO\Generators\Schema\Article; |
| 9 |
|
| 10 |
/** |
| 11 |
* Returns schema Article data. |
| 12 |
* |
| 13 |
* @since 10.2 |
| 14 |
* @deprecated 14.0 |
| 15 |
*/ |
| 16 |
class WPSEO_Schema_Article extends WPSEO_Deprecated_Graph_Piece { |
| 17 |
|
| 18 |
/** |
| 19 |
* The date helper. |
| 20 |
* |
| 21 |
* @var WPSEO_Date_Helper |
| 22 |
*/ |
| 23 |
protected $date; |
| 24 |
|
| 25 |
/** |
| 26 |
* WPSEO_Schema_Article constructor. |
| 27 |
* |
| 28 |
* @deprecated 14.0 |
| 29 |
* @codeCoverageIgnore |
| 30 |
* |
| 31 |
* @param array|null $context The context. No longer used but present for BC. |
| 32 |
*/ |
| 33 |
public function __construct( $context = null ) { |
| 34 |
parent::__construct( Article::class ); |
| 35 |
|
| 36 |
$this->date = new WPSEO_Date_Helper(); |
| 37 |
} |
| 38 |
|
| 39 |
/** |
| 40 |
* Determines whether a given post type should have Article schema. |
| 41 |
* |
| 42 |
* @deprecated 14.0 |
| 43 |
* @codeCoverageIgnore |
| 44 |
* |
| 45 |
* @param string|null $post_type Post type to check. |
| 46 |
* |
| 47 |
* @return bool True if it has article schema, false if not. |
| 48 |
*/ |
| 49 |
public static function is_article_post_type( $post_type = null ) { |
| 50 |
_deprecated_function( __METHOD__, 'WPSEO 14.0', 'YoastSEO()->helpers->schema->article->is_article_post_type' ); |
| 51 |
|
| 52 |
return YoastSEO()->helpers->schema->article->is_article_post_type( $post_type ); |
| 53 |
} |
| 54 |
} |
| 55 |
|