| 1 |
<?php |
| 2 |
/** |
| 3 |
* WPSEO plugin file. |
| 4 |
* |
| 5 |
* @package WPSEO\Frontend\Schema |
| 6 |
*/ |
| 7 |
|
| 8 |
use Yoast\WP\SEO\Generators\Schema\WebPage; |
| 9 |
|
| 10 |
/** |
| 11 |
* Returns schema WebPage data. |
| 12 |
* |
| 13 |
* @since 10.2 |
| 14 |
* @deprecated 14.0 |
| 15 |
*/ |
| 16 |
class WPSEO_Schema_WebPage 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_WebPage constructor. |
| 27 |
* |
| 28 |
* @deprecated 14.0 |
| 29 |
* @codeCoverageIgnore |
| 30 |
* |
| 31 |
* @param null $context The context. No longer used but present for BC. |
| 32 |
*/ |
| 33 |
public function __construct( $context = null ) { |
| 34 |
parent::__construct( WebPage::class ); |
| 35 |
|
| 36 |
$this->date = new WPSEO_Date_Helper(); |
| 37 |
} |
| 38 |
|
| 39 |
/** |
| 40 |
* Adds an author property to the $data if the WebPage is not represented. |
| 41 |
* |
| 42 |
* @deprecated 14.0 |
| 43 |
* @codeCoverageIgnore |
| 44 |
* |
| 45 |
* @param array $data The WebPage schema. |
| 46 |
* @param WP_Post $post The post the context is representing. |
| 47 |
* |
| 48 |
* @return array The WebPage schema. |
| 49 |
*/ |
| 50 |
public function add_author( $data, $post ) { |
| 51 |
_deprecated_function( __METHOD__, 'WPSEO 14.0', 'Yoast\WP\SEO\Generators\Schema\WebPage::add_author' ); |
| 52 |
|
| 53 |
return $this->stable->add_author( $data, $post ); |
| 54 |
} |
| 55 |
|
| 56 |
/** |
| 57 |
* If we have an image, make it the primary image of the page. |
| 58 |
* |
| 59 |
* @deprecated 14.0 |
| 60 |
* @codeCoverageIgnore |
| 61 |
* |
| 62 |
* @param array $data WebPage schema data. |
| 63 |
*/ |
| 64 |
public function add_image( &$data ) { |
| 65 |
_deprecated_function( __METHOD__, 'WPSEO 14.0', 'Yoast\WP\SEO\Generators\Schema\WebPage::add_image' ); |
| 66 |
|
| 67 |
$this->stable->add_image( $data ); |
| 68 |
} |
| 69 |
} |
| 70 |
|