PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / trunk
Yoast SEO – Advanced SEO with real-time guidance and built-in AI vtrunk
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
← All changes | src/helpers/schema/image-helper.php +7 -7 18.9 → trunk View file →
@@ -1,9 +1,8 @@
1 1 <?php
2 2
3 3 namespace Yoast\WP\SEO\Helpers\Schema;
4 4
5 -use Yoast\WP\SEO\Config\Schema_IDs;
6 5 use Yoast\WP\SEO\Helpers\Image_Helper as Main_Image_Helper;
7 6
8 7 /**
9 8 * Class Image_Helper.
@@ -48,17 +47,18 @@
48 47
49 48 /**
50 49 * Find an image based on its URL and generate a Schema object for it.
51 50 *
52 - * @param string $schema_id The `@id` to use for the returned image.
53 - * @param string $url The image URL to base our object on.
54 - * @param string $caption An optional caption.
55 - * @param bool $add_hash Whether a hash will be added as a suffix in the @id.
51 + * @param string $schema_id The `@id` to use for the returned image.
52 + * @param string $url The image URL to base our object on.
53 + * @param string $caption An optional caption.
54 + * @param bool $add_hash Whether a hash will be added as a suffix in the @id.
55 + * @param bool $use_link_table Whether the SEO Links table will be used to retrieve the id.
56 56 *
57 57 * @return array Schema ImageObject array.
58 58 */
59 - public function generate_from_url( $schema_id, $url, $caption = '', $add_hash = false ) {
60 - $attachment_id = $this->image->get_attachment_by_url( $url );
59 + public function generate_from_url( $schema_id, $url, $caption = '', $add_hash = false, $use_link_table = true ) {
60 + $attachment_id = $this->image->get_attachment_by_url( $url, $use_link_table );
61 61 if ( $attachment_id > 0 ) {
62 62 return $this->generate_from_attachment_id( $schema_id, $attachment_id, $caption, $add_hash );
63 63 }
64 64