Skip to content

Commit ca8db6f

Browse files
committed
Added requires plugins header to mitigate crashing.
1 parent adc693e commit ca8db6f

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

schema/tsf-image-graph.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* License: GPLv3
1010
* Requires at least: 5.9
1111
* Requires PHP: 7.4.0
12+
* Requires Plugins: autodescription
1213
*
1314
* @package My_The_SEO_Framework\SchemaImage
1415
*/
@@ -21,8 +22,8 @@ function ( $graph, $args ) {
2122

2223
foreach ( $graph as &$data ) {
2324
if ( 'WebPage' === $data['@type'] ) {
24-
$data['primaryImageOfPage'] = My_Graph_Image::get_instant_ref( $args );
2525
$data['image'] = &My_Graph_Image::get_dynamic_ref( $args );
26+
$data['primaryImageOfPage'] = My_Graph_Image::get_instant_ref( $args );
2627
}
2728
}
2829

@@ -66,8 +67,10 @@ public static function build( $args = null ) {
6667

6768
$entity = [];
6869

69-
// TODO: We'll probably turn 'social' into 'search' when this gets implemented.
70-
foreach ( \tsf()->image()->get_image_details( $args, false, 'social' ) as $image ) {
70+
// TODO: We'll probably turn 'social' into 'schema' when this gets implemented.
71+
// We should also decouple this from the My_Graph_Image object since static::$type needs to become iterably changed.
72+
// Hence, this will probably be the first graph item that is iterable.
73+
foreach ( \tsf()->image()->get_image_details( $args, false, 'schema' ) as $image ) {
7174
$details = [
7275
'@id' => static::get_id( $args ),
7376
'@type' => &static::$type,

0 commit comments

Comments
 (0)