-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathedit-author-slug.php
113 lines (103 loc) · 3.06 KB
/
edit-author-slug.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<?php
/**
* Plugin Name: Edit Author Slug
* Plugin URI: https://github.com/thebrandonallen/edit-author-slug/
* Description: Allows an Admin (or capable user) to edit the author slug of a user, and change the Author Base. <em>i.e. - (WordPress default structure) http://example.com/author/username/ (Plugin allows) http://example.com/ninja/master-ninja/</em>
* Author: Brandon Allen
* Author URI: https://github.com/thebrandonallen/
* Text Domain: edit-author-slug
* Domain Path: /languages
* Version: 1.9.1
* Requires at least: 5.8
* Requires PHP: 7.4
* License: GPLv2 or later
* License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*
* Copyright (C) 2009-2024 Brandon Allen (https://github.com/thebrandonallen)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* @package Edit_Author_Slug
* @subpackage Main
* @author Brandon Allen
* @version 1.9.1
*/
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
// Load the plugin class file.
require 'includes/classes/class-ba-edit-author-slug.php';
/**
* Runs on Edit Author Slug activation.
*
* @since 0.7.0
*
* @return void
*/
function ba_eas_activation() {
/**
* Fires on Edit Author Slug activation.
*
* @since 0.7.0
*/
do_action( 'ba_eas_activation' );
}
register_activation_hook( __FILE__, 'ba_eas_activation' );
/**
* Runs on Edit Author Slug deactivation.
*
* @since 0.7.0
*
* @return void
*/
function ba_eas_deactivation() {
/**
* Fires on Edit Author Slug deactivation.
*
* @since 0.7.0
*/
do_action( 'ba_eas_deactivation' );
}
register_deactivation_hook( __FILE__, 'ba_eas_deactivation' );
/**
* The main function responsible for returning the one true BA_Edit_Author_Slug
* Instance to functions everywhere.
*
* Use this function like you would a global variable, except without needing
* to declare the global.
*
* Example: <?php $ba_eas = ba_eas(); ?>
*
* @return BA_Edit_Author_Slug The one true BA_Edit_Author_Slug Instance.
*/
function ba_eas() {
return BA_Edit_Author_Slug::instance();
}
/**
* Initialize Edit Author Slug.
*
* @since 1.7.0
*/
function ba_eas_init() {
// Initialize the plugin.
$eas = ba_eas();
$eas->setup_actions();
/**
* Fires after Edit Author Slug has been loaded and initialized.
*
* @since 1.7.0
*/
do_action( 'ba_eas_loaded' );
}
add_action( 'plugins_loaded', 'ba_eas_init' );