diff options
Diffstat (limited to 'plugins/archiveorg/archiveorg.php')
-rw-r--r-- | plugins/archiveorg/archiveorg.php | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/plugins/archiveorg/archiveorg.php b/plugins/archiveorg/archiveorg.php new file mode 100644 index 00000000..1db3e4cb --- /dev/null +++ b/plugins/archiveorg/archiveorg.php | |||
@@ -0,0 +1,18 @@ | |||
1 | <?php | ||
2 | |||
3 | /** | ||
4 | * Add archive.org icon to link_plugin when rendering linklist. | ||
5 | * | ||
6 | * @param $data - linklist data. | ||
7 | * @return mixed - linklist data with archive.org plugin. | ||
8 | */ | ||
9 | function hook_archiveorg_render_linklist($data) { | ||
10 | $archive_html = file_get_contents(PluginManager::$PLUGINS_PATH . '/archiveorg/archiveorg.html'); | ||
11 | |||
12 | foreach ($data['links'] as &$value) { | ||
13 | $archive = sprintf($archive_html, $value['url']); | ||
14 | $value['link_plugin'][] = $archive; | ||
15 | } | ||
16 | |||
17 | return $data; | ||
18 | } | ||