Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 50 additions & 48 deletions Herbert/Framework/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,10 +239,10 @@ protected function notifyMismatched()
}, $this->mismatched);

$message = 'Unfortunately plugin(s) '
. implode(', ', $mismatched)
. ' can’t work with the following plugin(s) '
. implode(', ', $matched)
. '. Please disable and try updating all of the above plugins before reactivating.';
. implode(', ', $mismatched)
. ' can’t work with the following plugin(s) '
. implode(', ', $matched)
. '. Please disable and try updating all of the above plugins before reactivating.';

Notifier::error($message);
}
Expand All @@ -255,50 +255,52 @@ protected function notifyMismatched()
*/
public function loadPlugin($config)
{
$this->loadPluginRequires(
array_get($config, 'requires', [])
);

$this->loadPluginRoutes(
'router',
array_get($config, 'routes', [])
);

$this->loadPluginPanels(
'panel',
array_get($config, 'panels', [])
);

$this->loadPluginX(
'enqueue',
array_get($config, 'enqueue', [])
);

$this->loadPluginX(
'shortcode',
array_get($config, 'shortcodes', [])
);

$this->loadPluginX(
'widget',
array_get($config, 'widgets', [])
);

$this->loadPluginAPIs(
array_get($config, 'apis', [])
);

$this->addPluginTwigNamespaces(
array_get($config, 'views', [])
);

$this->addPluginViewGlobals(
array_get($config, 'viewGlobals', [])
);

$this->addPluginComposers(
array_get($config, 'viewComposers', [])
);
add_action('init', function () use ($config) {
$this->loadPluginRequires(
array_get($config, 'requires', [])
);

$this->loadPluginRoutes(
'router',
array_get($config, 'routes', [])
);

$this->loadPluginPanels(
'panel',
array_get($config, 'panels', [])
);

$this->loadPluginX(
'enqueue',
array_get($config, 'enqueue', [])
);

$this->loadPluginX(
'shortcode',
array_get($config, 'shortcodes', [])
);

$this->loadPluginX(
'widget',
array_get($config, 'widgets', [])
);

$this->loadPluginAPIs(
array_get($config, 'apis', [])
);

$this->addPluginTwigNamespaces(
array_get($config, 'views', [])
);

$this->addPluginViewGlobals(
array_get($config, 'viewGlobals', [])
);

$this->addPluginComposers(
array_get($config, 'viewComposers', [])
);
});
}

/**
Expand Down
5 changes: 1 addition & 4 deletions Herbert/Framework/Shortcode.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,7 @@ public function add($name, $callable, $arguments = [])

$response = $this->app->call(
$callable,
array_merge([
'_attributes' => $attributes,
'_content' => $content
], $attributes)
$attributes
);

if ($response instanceof RedirectResponse)
Expand Down