Elgg  Version master
robots.txt.php
Go to the documentation of this file.
1 <?php
2 
4 header('Content-type: text/plain; charset=utf-8');
5 
6 $content = $site->getMetadata('robots.txt');
7 $plugin_content = elgg_trigger_event_results('robots.txt', 'site', ['site' => $site], '');
8 if (!empty($plugin_content) && is_string($plugin_content)) {
9  $content .= PHP_EOL . PHP_EOL . $plugin_content;
10 }
11 
12 echo $content;
elgg_trigger_event_results(string $event, string $type, array $params=[], $returnvalue=null)
Triggers an event where it is expected that the mixed return value could be manipulated by event call...
Definition: events.php:117
$plugin_content
Definition: robots.txt.php:7
elgg_get_site_entity()
Get the current site entity.
Definition: entities.php:101
$site
Definition: robots.txt.php:3
$content
Definition: robots.txt.php:6