-
Notifications
You must be signed in to change notification settings - Fork 0
/
snoka-maintenance-mode.php
34 lines (30 loc) · 1.04 KB
/
snoka-maintenance-mode.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
/**
* Plugin Name: Snoka Maintenance Mode
* Plugin URI: https://snoka.ca
* Description: Enable maintenance mode with customizable options.
* Version: 1.0
* Author: Snoka Media
* Author URI: https://snoka.ca
*
* @package SnokaMaintenanceMode
*/
// Include the settings page and functions file.
require_once plugin_dir_path(__FILE__) . 'admin/settings-page.php';
require_once plugin_dir_path(__FILE__) . 'includes/functions.php';
/**
* Hook into WordPress to add the settings page and check maintenance status.
*/
add_action('admin_menu', 'snoka_maintenance_mode_add_admin_menu');
add_action('get_header', 'snoka_maintenance_mode_check_status');
/**
* Register hook for executing code on plugin deactivation.
*/
register_deactivation_hook(__FILE__, 'snoka_maintenance_mode_deactivate');
/**
* Cleans up the database by removing options added by the plugin upon deactivation.
*/
function snoka_maintenance_mode_deactivate()
{
delete_option('snoka_maintenance_mode_options');
}