WP: Add empty events for admin actions

This commit is contained in:
Matias Griese
2015-07-17 14:48:33 +03:00
parent 575afd286b
commit f125aeb379
@@ -0,0 +1,56 @@
<?php
/**
* @package Gantry5
* @author RocketTheme http://www.rockettheme.com
* @copyright Copyright (C) 2007 - 2015 RocketTheme, LLC
* @license GNU/GPLv2 and later
*
* http://www.gnu.org/licenses/gpl-2.0.html
*/
namespace Gantry\Admin;
use RocketTheme\Toolbox\Event\Event;
use RocketTheme\Toolbox\Event\EventSubscriberInterface;
class EventListener implements EventSubscriberInterface
{
public static function getSubscribedEvents()
{
return [
'admin.global.save' => ['onGlobalSave', 0],
'admin.styles.save' => ['onStylesSave', 0],
'admin.settings.save' => ['onSettingsSave', 0],
'admin.layout.save' => ['onLayoutSave', 0],
'admin.assignments.save' => ['onAssignmentsSave', 0],
'admin.menus.save' => ['onMenusSave', 0]
];
}
public function onGlobalSave(Event $event)
{
// In this function we need to save settings into plugin.
}
public function onStylesSave(Event $event)
{
}
public function onSettingsSave(Event $event)
{
}
public function onLayoutSave(Event $event)
{
}
public function onAssignmentsSave(Event $event)
{
}
public function onMenusSave(Event $event)
{
// Here we need to modify WP menus.
}
}