Skip to content

Commit

Permalink
Fixed #5 (Works on first page displayed)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sommerregen committed Sep 9, 2015
1 parent 10764da commit 74005b3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
4 changes: 2 additions & 2 deletions classes/ExternalLinks.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class ExternalLinks
/**
* @var ExternalLinks
*/
use GravTrait;
use GravTrait;

/** -------------
* Public methods
Expand All @@ -39,7 +39,7 @@ class ExternalLinks
*
* @return string The processed content
*/
public function process($content, $options = [])
public function process($content, $options = [])
{
// Get all <a> tags and process them
$content = preg_replace_callback('~<a[^>]*>.*?</a>~i',
Expand Down
5 changes: 1 addition & 4 deletions external_links.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public static function getSubscribedEvents()
{
return [
'onTwigInitialized' => ['onTwigInitialized', 0],
'onTwigSiteVariables' => ['onTwigSiteVariables', 0],
'onBuildPagesInitialized' => ['onBuildPagesInitialized', 0]
];
}
Expand Down Expand Up @@ -191,10 +192,6 @@ protected function init()
// Initialize back-end
require_once(__DIR__ . '/classes/ExternalLinks.php');
$this->backend = new ExternalLinks();

$this->enable([
'onTwigSiteVariables' => ['onTwigSiteVariables', 0]
]);
}

return $this->backend;
Expand Down

0 comments on commit 74005b3

Please sign in to comment.