From aef04931540c27c1fe57ce8356df85466183641e Mon Sep 17 00:00:00 2001 From: Giuseppe Di Terlizzi Date: Thu, 26 Mar 2015 01:48:51 +0100 Subject: [PATCH] Fix "relatedLink" NULL in Schema.org/WebPage for backlinks --- action.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/action.php b/action.php index d200773..74e9a43 100644 --- a/action.php +++ b/action.php @@ -124,10 +124,14 @@ class action_plugin_semantic extends DokuWiki_Action_Plugin { } } - $event->data["script"][] = array ( - "type" => "application/ld+json", - "_data" => json_encode($json_ld_webpage), - ); + if (isset($json_ld_webpage['relatedLink'])) { + + $event->data["script"][] = array ( + "type" => "application/ld+json", + "_data" => json_encode($json_ld_webpage), + ); + + } }