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/open-graph/image-helper.php +10 -6 18.7 → trunk View file →
@@ -39,13 +39,18 @@
39 39
40 40 /**
41 41 * Determines whether the passed URL is considered valid.
42 42 *
43 - * @param array $image The image array.
43 + * @deprecated 22.4
44 + * @codeCoverageIgnore
44 45 *
46 + * @param array<array<string, string|int>> $image The image array.
47 + *
45 48 * @return bool Whether or not the URL is a valid image.
46 49 */
47 50 public function is_image_url_valid( array $image ) {
51 + \_deprecated_function( __METHOD__, 'Yoast SEO 22.4' );
52 +
48 53 if ( empty( $image['url'] ) || ! \is_string( $image['url'] ) ) {
49 54 return false;
50 55 }
51 56
@@ -54,11 +59,10 @@
54 59
55 60 /**
56 61 * Filter: 'wpseo_opengraph_is_valid_image_url' - Allows extra validation for an image url.
57 62 *
58 - * @api bool - Current validation result.
59 - *
60 - * @param string $url The image url to validate.
63 + * @param bool $is_valid Current validation result.
64 + * @param string $url The image url to validate.
61 65 */
62 66 return (bool) \apply_filters( 'wpseo_opengraph_is_valid_image_url', $is_valid, $image['url'] );
63 67 }
64 68
@@ -79,9 +83,9 @@
79 83 * Use the `wpseo_image_sizes` filter if you want to use our logic. That filter
80 84 * can be used to add an image size that needs to be taken into consideration
81 85 * within our own logic.
82 86 *
83 - * @api string|false $size Size string.
87 + * @param string|false $size Size string.
84 88 */
85 89 return \apply_filters( 'wpseo_opengraph_image_size', null );
86 90 }
87 91
@@ -89,9 +93,9 @@
89 93 * Retrieves the image data by a given attachment id.
90 94 *
91 95 * @param int $attachment_id The attachment id.
92 96 *
93 - * @return array|false The image data when found, `false` when not.
97 + * @return array<string, string|int>|false The image data when found, `false` when not.
94 98 */
95 99 public function get_image_by_id( $attachment_id ) {
96 100 if ( ! $this->image->is_valid_attachment( $attachment_id ) ) {
97 101 return false;