tra('Include URL'),
'documentation' => 'PluginIncludeURL',
'description' => tra('Include the body content from a URL'),
'prefs' => ['wikiplugin_includeurl'],
'iconname' => 'link-external',
'introduced' => 15,
'tags' => [ 'basic' ],
'format' => 'html',
'params' => [
'url' => [
'required' => true,
'name' => tra('URL'),
'description' => tra('URL to external file to include.'),
'since' => '15.0',
'filter' => 'url',
'default' => '',
],
],
];
}
function wikiplugin_includeurl($data, $params)
{
// Validate that "url" is set.
if (empty($params['url'])) {
return tr('Missing parameter url for plugin %0', 'includeurl') . '
';
} else {
$url = $params['url'];
$html = file_get_contents($url);
// Only include the body part of the html file
$matches = [];
if (preg_match("/