PluginProbe
Adminify – White Label, Admin Menu Editor, Login Customizer / 2.0.3
Adminify – White Label, Admin Menu Editor, Login Customizer v2.0.3
4.3.1 4.3.0 4.2.26 4.2.25 4.2.24 4.2.23 4.2.22 4.2.21 4.2.20 4.2.19 4.2.18 4.2.17 4.2.16 4.2.15 4.2.14 4.2.13 4.2.12 4.2.11 4.2.10 4.2.9 4.2.8 4.2.7 4.2.6 4.2.5 4.1.17 All 164 releases
adminify / Inc / Modules / ActivityLogs / Hooks / WP_Adminify_Logs_Menu.php

WP_Adminify_Logs_Menu.php in Adminify – White Label, Admin Menu Editor, Login Customizer 2.0.3, at Inc/Modules/ActivityLogs/Hooks/WP_Adminify_Logs_Menu.php

50 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace WPAdminify\Inc\Modules\ActivityLogs\Hooks;
4
5 use WPAdminify\Inc\Modules\ActivityLogs\Inc\Hooks_Base;
6
7 // no direct access allowed
8 if (!defined('ABSPATH')) exit;
9
10 class WP_Adminify_Logs_Menu extends Hooks_Base
11 {
12 public function __construct()
13 {
14 parent::__construct();
15 add_action('wp_update_nav_menu', [$this, 'hooks_menu_created_or_updated']);
16 add_action('wp_create_nav_menu', [$this, 'hooks_menu_created_or_updated']);
17 add_action('delete_nav_menu', [$this, 'hooks_menu_deleted'], 10, 3);
18 }
19
20
21 public function hooks_menu_created_or_updated($nav_menu_selected_id)
22 {
23 if ($menu_object = wp_get_nav_menu_object($nav_menu_selected_id)) {
24 if ('wp_create_nav_menu' === current_filter())
25 $action = 'created';
26 else
27 $action = 'updated';
28
29 adminify_activity_logs(
30 array(
31 'action' => $action,
32 'object_type' => 'Menu',
33 'object_name' => $menu_object->name,
34 )
35 );
36 }
37 }
38
39 public function hooks_menu_deleted($term, $tt_id, $deleted_term)
40 {
41 adminify_activity_logs(
42 array(
43 'action' => 'deleted',
44 'object_type' => 'Menu',
45 'object_name' => $deleted_term->name,
46 )
47 );
48 }
49 }
50