Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Commit 5a4669f

Browse files
committed
fixed rel-alternate implementation and added some tests
1 parent ded4cef commit 5a4669f

File tree

5 files changed

+2179
-1
lines changed

5 files changed

+2179
-1
lines changed

composer.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@
3333
"composer update",
3434
"bin/install-wp-tests.sh wordpress wordpress wordpress",
3535
"vendor/bin/phpunit"
36+
],
37+
"test-local": [
38+
"composer update",
39+
"bin/install-wp-tests.sh wordpress wordpress wordpress 127.0.0.1 4.9.8 true",
40+
"vendor/bin/phpunit"
3641
]
3742
}
3843
}

includes/class-linkbacks-mf2-handler.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@ public static function generate_commentdata( $commentdata ) {
147147
// check for rel-alternate links
148148
if ( $alternate_source = self::get_alternate_source( $mf_array ) ) {
149149
$mf_array = $alternate_source;
150+
151+
var_dump($mf_array);
150152
}
151153

152154
// get all 'relevant' entries
@@ -479,7 +481,9 @@ public static function get_alternate_source( $mf_array ) {
479481
return false;
480482
}
481483

482-
return wp_remote_retrieve_body( $response );
484+
$body = wp_remote_retrieve_body( $response );
485+
486+
return json_decode( $body, true );
483487
}
484488

485489
/**

0 commit comments

Comments
 (0)