-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadmin-only.php
More file actions
47 lines (42 loc) · 1.36 KB
/
admin-only.php
File metadata and controls
47 lines (42 loc) · 1.36 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
/**
* Admin Only Dashboard
*
* @package Admin Only Dashboard
* @author Ga Satrya
* @copyright 2023 - 2026 Ga Satrya
* @license GPL-2.0-or-later
*
* @wordpress-plugin
* Plugin Name: UserFlow
* Plugin URI: https://wordpress.org/plugins/admin-only/
* Description: UserFlow: Only administrators can access the WordPress dashboard by default. Easily allow specific users to log in via a simple whitelist. Quick and easy setup.
* Version: 1.3.0
* Requires at least: 6.5
* Requires PHP: 7.0
* Author: Ga Satrya
* Author URI: https://www.ctaflow.com/
* License: GPL v2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Define plugin constants.
define( 'ADMON_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
define( 'ADMON_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
/**
* Load plugin functionality.
*/
function admon_load_plugin() {
// Load core functionality.
require_once ADMON_PLUGIN_DIR . 'includes/core.php';
// Load session functionality.
require_once ADMON_PLUGIN_DIR . 'includes/session.php';
// Load admin functionality.
if ( is_admin() ) {
require_once ADMON_PLUGIN_DIR . 'admin/settings.php';
}
}
add_action( 'plugins_loaded', 'admon_load_plugin' );