PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / 18.4
Yoast SEO – Advanced SEO with real-time guidance and built-in AI v18.4
28.5 28.4 28.3 28.2 28.1 28.0 27.9 27.8 27.7 27.6 27.5 trunk 18.0 18.1 18.2 18.3 18.4 18.4.1 18.5 18.5.1 18.6 18.7 18.8 18.9 19.0 All 129 releases
wordpress-seo / src / deprecated / frontend / schema / class-schema-main-image.php

class-schema-main-image.php in Yoast SEO – Advanced SEO with real-time guidance and built-in AI 18.4, at src/deprecated/frontend/schema/class-schema-main-image.php

80 lines 2.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * WPSEO plugin file.
4 *
5 * @package WPSEO\Frontend\Schema
6 */
7
8 use Yoast\WP\SEO\Generators\Schema\Main_Image;
9
10 /**
11 * Returns ImageObject schema data.
12 *
13 * @since 11.5
14 * @deprecated 14.0
15 * @codeCoverageIgnore
16 */
17 class WPSEO_Schema_MainImage extends WPSEO_Deprecated_Graph_Piece {
18
19 /**
20 * WPSEO_Schema_WebPage constructor.
21 *
22 * @deprecated 14.0
23 * @codeCoverageIgnore
24 *
25 * @param null $context The context. No longer used but present for BC.
26 */
27 public function __construct( $context = null ) {
28 parent::__construct( Main_Image::class );
29 }
30
31 /**
32 * Gets the post's first usable content image. Null if none is available.
33 *
34 * @deprecated 14.0
35 * @codeCoverageIgnore
36 *
37 * @param int $post_id The post id.
38 *
39 * @return string|null The image URL or null if there is no image.
40 */
41 protected function get_first_usable_content_image_for_post( $post_id ) {
42 _deprecated_function( __METHOD__, 'WPSEO 14.0' );
43
44 return WPSEO_Image_Utils::get_first_usable_content_image_for_post( $post_id );
45 }
46
47 /**
48 * Generates image schema from the attachment id.
49 *
50 * @deprecated 14.0
51 * @codeCoverageIgnore
52 *
53 * @param string $image_id The image schema id.
54 *
55 * @return array Schema ImageObject array.
56 */
57 protected function generate_image_schema_from_attachment_id( $image_id ) {
58 _deprecated_function( __METHOD__, 'WPSEO 14.0', 'YoastSEO()->helpers->schema->image->generate_from_attachment_id' );
59
60 return $this->helpers->schema->image->generate_from_attachment_id( $image_id, get_post_thumbnail_id() );
61 }
62
63 /**
64 * Generates image schema from the url.
65 *
66 * @deprecated 14.0
67 * @codeCoverageIgnore
68 *
69 * @param string $image_id The image schema id.
70 * @param string $image_url The image URL.
71 *
72 * @return array Schema ImageObject array.
73 */
74 protected function generate_image_schema_from_url( $image_id, $image_url ) {
75 _deprecated_function( __METHOD__, 'WPSEO 14.0', 'YoastSEO()->helpers->schema->image->generate_from_url' );
76
77 return $this->helpers->schema->image->generate_from_url( $image_id, $image_url );
78 }
79 }
80