PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / 18.3
Yoast SEO – Advanced SEO with real-time guidance and built-in AI v18.3
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 / values / open-graph / images.php

images.php in Yoast SEO – Advanced SEO with real-time guidance and built-in AI 18.3, at src/values/open-graph/images.php

57 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Yoast\WP\SEO\Values\Open_Graph;
4
5 use Yoast\WP\SEO\Helpers\Open_Graph\Image_Helper as Open_Graph_Image_Helper;
6 use Yoast\WP\SEO\Values\Images as Base_Images;
7
8 /**
9 * Value object for the Open Graph Images.
10 */
11 class Images extends Base_Images {
12
13 /**
14 * The Open Graph image helper.
15 *
16 * @var Open_Graph_Image_Helper
17 */
18 protected $open_graph_image;
19
20 /**
21 * Sets the helpers.
22 *
23 * @required
24 *
25 * @codeCoverageIgnore - Is handled by DI-container.
26 *
27 * @param Open_Graph_Image_Helper $open_graph_image Image helper for Open Graph.
28 */
29 public function set_helpers( Open_Graph_Image_Helper $open_graph_image ) {
30 $this->open_graph_image = $open_graph_image;
31 }
32
33 /**
34 * Outputs the images.
35 *
36 * @codeCoverageIgnore - The method is empty, nothing to test.
37 *
38 * @return void
39 */
40 public function show() {}
41
42 /**
43 * Adds an image to the list by image ID.
44 *
45 * @param int $image_id The image ID to add.
46 *
47 * @return void
48 */
49 public function add_image_by_id( $image_id ) {
50 $attachment = $this->open_graph_image->get_image_by_id( $image_id );
51
52 if ( $attachment ) {
53 $this->add_image( $attachment );
54 }
55 }
56 }
57