PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / 28.3
Yoast SEO – Advanced SEO with real-time guidance and built-in AI v28.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 / twitter / images.php

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

50 lines 976 B
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\Twitter;
4
5 use Yoast\WP\SEO\Helpers\Twitter\Image_Helper as Twitter_Image_Helper;
6 use Yoast\WP\SEO\Values\Images as Base_Images;
7
8 /**
9 * Value object for the twitter Images.
10 */
11 class Images extends Base_Images {
12
13 /**
14 * The twitter image helper.
15 *
16 * @var Twitter_Image_Helper
17 */
18 protected $twitter_image;
19
20 /**
21 * Sets the helpers.
22 *
23 * @required
24 *
25 * @codeCoverageIgnore - Is handled by DI-container.
26 *
27 * @param Twitter_Image_Helper $twitter_image Image helper for twitter.
28 *
29 * @return void
30 */
31 public function set_helpers( Twitter_Image_Helper $twitter_image ) {
32 $this->twitter_image = $twitter_image;
33 }
34
35 /**
36 * Adds an image to the list by image ID.
37 *
38 * @param int $image_id The image ID to add.
39 *
40 * @return void
41 */
42 public function add_image_by_id( $image_id ) {
43 $attachment = $this->twitter_image->get_by_id( $image_id );
44
45 if ( $attachment ) {
46 $this->add_image( $attachment );
47 }
48 }
49 }
50