mirror of
https://github.com/gantry/gantry5.git
synced 2026-08-19 01:15:04 -05:00
WP: Add empty events for admin actions
This commit is contained in:
@@ -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.
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user