Version Description
- Release date: 2019-09-05
- Removes pre-WP 4.5 cache busting. The minimum version has been 4.7 for quite some time, and, as of WP 4.5, the cache busting was redundant.
- Don't show the options page if
ba_eas_can_edit_author_slug()
returnsfalse
. - Bumps "Tested up to" version to 5.2.3
Download this release
Release Info
Developer | thebrandonallen |
Plugin | Edit Author Slug |
Version | 1.6.1 |
Comparing to | |
See all releases |
Code changes from version 1.6.0 to 1.6.1
- CHANGELOG.md +6 -0
- README.md +130 -124
- edit-author-slug.php +3 -3
- includes/admin.php +11 -12
- includes/deprecated.php +1 -39
- includes/functions.php +1 -10
- js/edit-author-slug.js +5 -3
- js/edit-author-slug.min.js +1 -1
- languages/edit-author-slug.pot +39 -39
- readme.txt +8 -2
CHANGELOG.md
CHANGED
@@ -3,6 +3,12 @@ All notable changes to this project will be documented in this file.
|
|
3 |
|
4 |
The format is based on [Keep a Changelog](http://keepachangelog.com/).
|
5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
## [1.6.0](https://github.com/thebrandonallen/edit-author-slug/tree/1.6.0) - 2018-10-11 ##
|
7 |
### Added
|
8 |
* Add compatibility for iThemes Force Unique Nickname WordPress Tweak
|
3 |
|
4 |
The format is based on [Keep a Changelog](http://keepachangelog.com/).
|
5 |
|
6 |
+
## [1.6.1](https://github.com/thebrandonallen/edit-author-slug/tree/1.6.1) - 2019-09-05 ##
|
7 |
+
### Changed
|
8 |
+
* Removes pre-WP 4.5 cache busting. The minimum version has been 4.7 for quite some time, and, as of WP 4.5, the cache busting was redundant.
|
9 |
+
* Don't show the options page if `ba_eas_can_edit_author_slug()` returns `false`. [GH-21]
|
10 |
+
* Bumps "Tested up to" version to 5.2.3
|
11 |
+
|
12 |
## [1.6.0](https://github.com/thebrandonallen/edit-author-slug/tree/1.6.0) - 2018-10-11 ##
|
13 |
### Added
|
14 |
* Add compatibility for iThemes Force Unique Nickname WordPress Tweak
|
README.md
CHANGED
@@ -1,124 +1,130 @@
|
|
1 |
-
# Edit Author Slug [![Build Status](https://travis-ci.org/thebrandonallen/edit-author-slug.svg?branch=master)](https://travis-ci.org/thebrandonallen/edit-author-slug) #
|
2 |
-
**Contributors:** [thebrandonallen](https://profiles.wordpress.org/thebrandonallen)
|
3 |
-
**Tags:** author, author base, author slug, user nicename, nicename, permalink, permalinks, slug, users, user, role, roles
|
4 |
-
**Requires at least:** 4.7
|
5 |
-
**Tested up to:**
|
6 |
-
**Requires PHP:** 5.3
|
7 |
-
**Stable tag:** 1.6.
|
8 |
-
**License:** GPLv2 or later
|
9 |
-
**License URI:** https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
10 |
-
|
11 |
-
Allows an admin (or capable user) to edit the author slug of a user, and change the author base.
|
12 |
-
|
13 |
-
## Description ##
|
14 |
-
|
15 |
-
This plugin allows full control of your user permalinks, allowing you to change both the author base (the '/author/' portion of the author URLs), and the author slug (defaults to the username of the author). You can set the author base globally, or you can set it to be user-specific based on a user's role. You now have the power to craft the perfect URL structure for you Author pages.
|
16 |
-
|
17 |
-
WordPress default structure *http://example.com/author/username/*.
|
18 |
-
|
19 |
-
Edit Author Slug allows for *http://example.com/ninja/master-ninja/*.
|
20 |
-
|
21 |
-
Using a role-based author base would allow for *http://example.com/ida/master-splinter/* (for an Administrator Role), or *http://example.com/koga/leonardo/* (for a Subscriber Role).
|
22 |
-
|
23 |
-
Development of this plugin takes place on [GitHub](https://github.com/thebrandonallen/edit-author-slug/ "Edit Author Slug on Github"). Pull requests are always welcome!
|
24 |
-
|
25 |
-
Translations should be submitted to [Translate WordPress](https://translate.wordpress.org/projects/wp-plugins/edit-author-slug).
|
26 |
-
|
27 |
-
## Installation ##
|
28 |
-
|
29 |
-
1. Upload `edit-author-slug` folder to your WordPress plugins directory (typically 'wp-content/plugins')
|
30 |
-
2. Activate the plugin through the 'Plugins' menu in WordPress
|
31 |
-
3. Go to Users > Your Profile, or Users > All Users > (username), and edit the author slug.
|
32 |
-
4. Click "Update Profile" or "Update User"
|
33 |
-
5. Go to Settings > Edit Author Slug to edit settings
|
34 |
-
6. Click "Save Changes"
|
35 |
-
|
36 |
-
## Screenshots ##
|
37 |
-
|
38 |
-
1. Settings
|
39 |
-
2. Individual user author slug
|
40 |
-
|
41 |
-
## Frequently Asked Questions ##
|
42 |
-
|
43 |
-
### What is an author slug? ###
|
44 |
-
|
45 |
-
On standard WordPress installs, it's the final part of an author permalink.
|
46 |
-
e.g. - https://example.com/author/author-slug/
|
47 |
-
|
48 |
-
In relation to WordPress internals, the author slug is the same as the `user_nicename` field found in a `WP_User` object, or the users table in the database.
|
49 |
-
|
50 |
-
### Will my changes persist if I deactivate or delete the Edit Author Slug plugin? ###
|
51 |
-
|
52 |
-
It depends.
|
53 |
-
|
54 |
-
Changing a user's author slug is permanent, as this changes the user's `user_nicename` field in the database.
|
55 |
-
|
56 |
-
If you've changed the author base, deactivating or deleting the plugin will revert your author base back to `author`.
|
57 |
-
|
58 |
-
### Why can't I edit my Author Slug? ###
|
59 |
-
|
60 |
-
Make sure you are an admin, or have been assigned the `edit_users` capability.
|
61 |
-
|
62 |
-
### Why isn't my new Author Slug working? ###
|
63 |
-
|
64 |
-
While I've made every attempt to prevent this, I may have missed a spot or two. First things first, go to Settings > Permalinks and click "Save Changes." You don't need to actually need to make any changes for this to work. Hopefully, this should kick your new Author Slug into gear.
|
65 |
-
|
66 |
-
If this doesn't work, make sure you don't have any slug conflicts from other posts/pages/plugins/permalink setting/etc. If you're still experiencing the issue, feel free to post a support request in the forums.
|
67 |
-
|
68 |
-
## Changelog ##
|
69 |
-
|
70 |
-
### 1.6.
|
71 |
-
* Release date:
|
72 |
-
*
|
73 |
-
*
|
74 |
-
*
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
*
|
80 |
-
*
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
*
|
90 |
-
*
|
91 |
-
|
92 |
-
### 1.
|
93 |
-
* Release date: 2017-
|
94 |
-
*
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
*
|
100 |
-
*
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
*
|
105 |
-
*
|
106 |
-
*
|
107 |
-
*
|
108 |
-
|
109 |
-
### 1.
|
110 |
-
* Release date:
|
111 |
-
*
|
112 |
-
*
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
*
|
117 |
-
*
|
118 |
-
*
|
119 |
-
|
120 |
-
|
121 |
-
*
|
122 |
-
|
123 |
-
|
124 |
-
* https://
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Edit Author Slug [![Build Status](https://travis-ci.org/thebrandonallen/edit-author-slug.svg?branch=master)](https://travis-ci.org/thebrandonallen/edit-author-slug) #
|
2 |
+
**Contributors:** [thebrandonallen](https://profiles.wordpress.org/thebrandonallen)
|
3 |
+
**Tags:** author, author base, author slug, user nicename, nicename, permalink, permalinks, slug, users, user, role, roles
|
4 |
+
**Requires at least:** 4.7
|
5 |
+
**Tested up to:** 5.2.3
|
6 |
+
**Requires PHP:** 5.3
|
7 |
+
**Stable tag:** 1.6.1
|
8 |
+
**License:** GPLv2 or later
|
9 |
+
**License URI:** https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
10 |
+
|
11 |
+
Allows an admin (or capable user) to edit the author slug of a user, and change the author base.
|
12 |
+
|
13 |
+
## Description ##
|
14 |
+
|
15 |
+
This plugin allows full control of your user permalinks, allowing you to change both the author base (the '/author/' portion of the author URLs), and the author slug (defaults to the username of the author). You can set the author base globally, or you can set it to be user-specific based on a user's role. You now have the power to craft the perfect URL structure for you Author pages.
|
16 |
+
|
17 |
+
WordPress default structure *http://example.com/author/username/*.
|
18 |
+
|
19 |
+
Edit Author Slug allows for *http://example.com/ninja/master-ninja/*.
|
20 |
+
|
21 |
+
Using a role-based author base would allow for *http://example.com/ida/master-splinter/* (for an Administrator Role), or *http://example.com/koga/leonardo/* (for a Subscriber Role).
|
22 |
+
|
23 |
+
Development of this plugin takes place on [GitHub](https://github.com/thebrandonallen/edit-author-slug/ "Edit Author Slug on Github"). Pull requests are always welcome!
|
24 |
+
|
25 |
+
Translations should be submitted to [Translate WordPress](https://translate.wordpress.org/projects/wp-plugins/edit-author-slug).
|
26 |
+
|
27 |
+
## Installation ##
|
28 |
+
|
29 |
+
1. Upload `edit-author-slug` folder to your WordPress plugins directory (typically 'wp-content/plugins')
|
30 |
+
2. Activate the plugin through the 'Plugins' menu in WordPress
|
31 |
+
3. Go to Users > Your Profile, or Users > All Users > (username), and edit the author slug.
|
32 |
+
4. Click "Update Profile" or "Update User"
|
33 |
+
5. Go to Settings > Edit Author Slug to edit settings
|
34 |
+
6. Click "Save Changes"
|
35 |
+
|
36 |
+
## Screenshots ##
|
37 |
+
|
38 |
+
1. Settings
|
39 |
+
2. Individual user author slug
|
40 |
+
|
41 |
+
## Frequently Asked Questions ##
|
42 |
+
|
43 |
+
### What is an author slug? ###
|
44 |
+
|
45 |
+
On standard WordPress installs, it's the final part of an author permalink.
|
46 |
+
e.g. - https://example.com/author/author-slug/
|
47 |
+
|
48 |
+
In relation to WordPress internals, the author slug is the same as the `user_nicename` field found in a `WP_User` object, or the users table in the database.
|
49 |
+
|
50 |
+
### Will my changes persist if I deactivate or delete the Edit Author Slug plugin? ###
|
51 |
+
|
52 |
+
It depends.
|
53 |
+
|
54 |
+
Changing a user's author slug is permanent, as this changes the user's `user_nicename` field in the database.
|
55 |
+
|
56 |
+
If you've changed the author base, deactivating or deleting the plugin will revert your author base back to `author`.
|
57 |
+
|
58 |
+
### Why can't I edit my Author Slug? ###
|
59 |
+
|
60 |
+
Make sure you are an admin, or have been assigned the `edit_users` capability.
|
61 |
+
|
62 |
+
### Why isn't my new Author Slug working? ###
|
63 |
+
|
64 |
+
While I've made every attempt to prevent this, I may have missed a spot or two. First things first, go to Settings > Permalinks and click "Save Changes." You don't need to actually need to make any changes for this to work. Hopefully, this should kick your new Author Slug into gear.
|
65 |
+
|
66 |
+
If this doesn't work, make sure you don't have any slug conflicts from other posts/pages/plugins/permalink setting/etc. If you're still experiencing the issue, feel free to post a support request in the forums.
|
67 |
+
|
68 |
+
## Changelog ##
|
69 |
+
|
70 |
+
### 1.6.1 ###
|
71 |
+
* Release date: 2019-09-05
|
72 |
+
* Removes pre-WP 4.5 cache busting. The minimum version has been 4.7 for quite some time, and, as of WP 4.5, the cache busting was redundant.
|
73 |
+
* Don't show the options page if `ba_eas_can_edit_author_slug()` returns `false`.
|
74 |
+
* Bumps "Tested up to" version to 5.2.3
|
75 |
+
|
76 |
+
### 1.6.0 ###
|
77 |
+
* Release date: 2018-10-11
|
78 |
+
* Minimum required WordPress version is now 4.7
|
79 |
+
* Settings page JS no longer depends on jQuery (switched to plain js)
|
80 |
+
* Add compatibility for iThemes Force Unique Nickname WordPress Tweak
|
81 |
+
* Add a hash string as an author slug option
|
82 |
+
* Minimum PHP version has been bumped to 5.3. This is a soft bump, meaning, the plugin should still run on PHP 5.2. However, PHP 5.2 is no longer, officially, supported.
|
83 |
+
|
84 |
+
### 1.5.2 ###
|
85 |
+
* Release date: 2017-06-21
|
86 |
+
* Fixed a regression where those using the default author based couldn't remove front unless they were also using role-based author bases. Props @thatherton.
|
87 |
+
|
88 |
+
### 1.5.1 ###
|
89 |
+
* Release date: 2017-06-02
|
90 |
+
* Fix PHP notice when manually updating a user profile. Props @mydigitalsauce.
|
91 |
+
|
92 |
+
### 1.5.0 ###
|
93 |
+
* Release date: 2017-05-30
|
94 |
+
* Bumped minimum required WordPress version to 4.4.
|
95 |
+
* Refactored bulk upgrading again. The original fix made things better, but not as good as it could be. This new refactoring drastically improves performance and memory usage.
|
96 |
+
* This release is primarily an under-the-hood release with a number of optimizations and performance improvements.
|
97 |
+
|
98 |
+
### 1.4.1 ###
|
99 |
+
* Release date: 2017-04-24
|
100 |
+
* Fix failing string replacement in bulk update message.
|
101 |
+
|
102 |
+
### 1.4.0 ###
|
103 |
+
* Release date: 2017-04-04
|
104 |
+
* Lots of code cleanup to better adhere to WordPress Coding Standards.
|
105 |
+
* Improved performance of `ba_eas_sanitize_author_base()` by preventing unnecessary processing.
|
106 |
+
* Fixed an issue where the demo author permalink URL could have a double slash.
|
107 |
+
* Improvements to bulk update for sites with a large user base.
|
108 |
+
|
109 |
+
### 1.3.0 ###
|
110 |
+
* Release date: 2017-01-25
|
111 |
+
* Fix a potential bug where a sanitized author base could end up with double forward slashes.
|
112 |
+
* Introduce the `%ba_eas_author_role%` permalink structure tag. This can be used to customize role-based author bases.
|
113 |
+
* Bonus: All alternative facts are now free!
|
114 |
+
|
115 |
+
### 1.2.1 ###
|
116 |
+
* Release date: 2016-02-29
|
117 |
+
* Fixed stupid error where the default user nicename wasn't being properly retrieved from the database. Sorry about that :(
|
118 |
+
* Unfortunately, some unicorns were lost during the development of this release, but they are a resilient creature.
|
119 |
+
|
120 |
+
### 1.2.0 ###
|
121 |
+
* Release date: 2016-02-01
|
122 |
+
* Added the ability to use forward slashes in the author base.
|
123 |
+
* Improved display on the settings page, and storing, of role slugs.
|
124 |
+
* Packaged translations are now removed. Anyone interested in translating the plugin should do so at [Translate WordPress](https://translate.wordpress.org/projects/wp-plugins/edit-author-slug).
|
125 |
+
* EXPERIMENTAL: Added the ability to set the author slug to a user's numeric user id. While I have tested this, I can't be sure that no one's site will implode. If all goes well, the experimental tag will be removed in the next major release (or two).
|
126 |
+
* Added ability to remove the front portion of author links.
|
127 |
+
* Accessibility improvements to the settings page.
|
128 |
+
|
129 |
+
### Full Changelog ###
|
130 |
+
* https://github.com/thebrandonallen/edit-author-slug/blob/master/CHANGELOG.md
|
edit-author-slug.php
CHANGED
@@ -7,9 +7,9 @@
|
|
7 |
* Author URI: https://github.com/thebrandonallen/
|
8 |
* Text Domain: edit-author-slug
|
9 |
* Domain Path: /languages
|
10 |
-
* Version: 1.6.
|
11 |
*
|
12 |
-
* Copyright (C) 2009-
|
13 |
*
|
14 |
* This program is free software; you can redistribute it and/or modify
|
15 |
* it under the terms of the GNU General Public License as published by
|
@@ -28,7 +28,7 @@
|
|
28 |
* @package Edit_Author_Slug
|
29 |
* @subpackage Main
|
30 |
* @author Brandon Allen
|
31 |
-
* @version 1.6.
|
32 |
*/
|
33 |
|
34 |
// Exit if accessed directly.
|
7 |
* Author URI: https://github.com/thebrandonallen/
|
8 |
* Text Domain: edit-author-slug
|
9 |
* Domain Path: /languages
|
10 |
+
* Version: 1.6.1
|
11 |
*
|
12 |
+
* Copyright (C) 2009-2019 Brandon Allen (https://github.com/thebrandonallen)
|
13 |
*
|
14 |
* This program is free software; you can redistribute it and/or modify
|
15 |
* it under the terms of the GNU General Public License as published by
|
28 |
* @package Edit_Author_Slug
|
29 |
* @subpackage Main
|
30 |
* @author Brandon Allen
|
31 |
+
* @version 1.6.1
|
32 |
*/
|
33 |
|
34 |
// Exit if accessed directly.
|
includes/admin.php
CHANGED
@@ -279,11 +279,6 @@ function ba_eas_update_user_nicename( $errors, $update, $user ) {
|
|
279 |
|
280 |
// Looks like we made it, so let's update.
|
281 |
$user->user_nicename = $user_nicename;
|
282 |
-
|
283 |
-
// Delete the old nicename from the cache.
|
284 |
-
// TODO: Remove when WP 4.5 is the minimum version.
|
285 |
-
// See https://core.trac.wordpress.org/ticket/35750.
|
286 |
-
wp_cache_delete( $old_user_nicename, 'userslugs' );
|
287 |
}
|
288 |
|
289 |
/**
|
@@ -405,15 +400,19 @@ function ba_eas_show_user_nicename_scripts( $hook_suffix = '' ) {
|
|
405 |
* Add the Edit Author Slug Settings Menu.
|
406 |
*
|
407 |
* @since 0.9.0
|
|
|
408 |
*/
|
409 |
function ba_eas_add_settings_menu() {
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
|
|
|
|
|
|
417 |
}
|
418 |
|
419 |
/**
|
279 |
|
280 |
// Looks like we made it, so let's update.
|
281 |
$user->user_nicename = $user_nicename;
|
|
|
|
|
|
|
|
|
|
|
282 |
}
|
283 |
|
284 |
/**
|
400 |
* Add the Edit Author Slug Settings Menu.
|
401 |
*
|
402 |
* @since 0.9.0
|
403 |
+
* @since 1.6.1 Only show the page if a user can edit author slugs.
|
404 |
*/
|
405 |
function ba_eas_add_settings_menu() {
|
406 |
+
// If the user can edit author slugs, maybe show the options page.
|
407 |
+
if ( ba_eas_can_edit_author_slug() ) {
|
408 |
+
add_options_page(
|
409 |
+
__( 'Edit Author Slug Settings', 'edit-author-slug' ),
|
410 |
+
__( 'Edit Author Slug', 'edit-author-slug' ),
|
411 |
+
'edit_users',
|
412 |
+
'edit-author-slug',
|
413 |
+
'ba_eas_settings_page_html'
|
414 |
+
);
|
415 |
+
}
|
416 |
}
|
417 |
|
418 |
/**
|
includes/deprecated.php
CHANGED
@@ -43,8 +43,6 @@ function ba_eas_auto_update_user_nicename_single( $user_id = 0 ) {
|
|
43 |
* @since 1.2.0
|
44 |
* @deprecated 1.5.0
|
45 |
*
|
46 |
-
* @global WP_Roles $wp_roles
|
47 |
-
*
|
48 |
* @return WP_Roles
|
49 |
*/
|
50 |
function ba_eas_get_wp_roles() {
|
@@ -95,10 +93,8 @@ function ba_eas_get_editable_roles() {
|
|
95 |
/**
|
96 |
* Clean and update the nicename cache.
|
97 |
*
|
98 |
-
* @todo This will no longer be necessary when WP 4.5 is the minimum version.
|
99 |
-
* @see https://core.trac.wordpress.org/ticket/35750
|
100 |
-
*
|
101 |
* @since 1.0.0
|
|
|
102 |
* @deprecated 1.5.0
|
103 |
*
|
104 |
* @param int $user_id The user id.
|
@@ -106,39 +102,5 @@ function ba_eas_get_editable_roles() {
|
|
106 |
* @param string $new_nicename The new user nicename.
|
107 |
*/
|
108 |
function ba_eas_update_nicename_cache( $user_id = 0, $old_user_data = '', $new_nicename = '' ) {
|
109 |
-
|
110 |
_deprecated_function( __FUNCTION__, '1.5.0', 'wp_cache_delete( $old_nicename, \'userslugs\' );' );
|
111 |
-
|
112 |
-
// Bail if there's no user.
|
113 |
-
if ( empty( $user_id ) && empty( $old_user_data->ID ) ) {
|
114 |
-
return;
|
115 |
-
}
|
116 |
-
|
117 |
-
// Get a user_id. This will probably never happen.
|
118 |
-
if ( empty( $user_id ) ) {
|
119 |
-
$user_id = $old_user_data->ID;
|
120 |
-
}
|
121 |
-
|
122 |
-
// We got here via `profile_update`.
|
123 |
-
if ( empty( $new_nicename ) ) {
|
124 |
-
|
125 |
-
// Get the new nicename.
|
126 |
-
$user = get_userdata( $user_id );
|
127 |
-
$new_nicename = $user->user_nicename;
|
128 |
-
}
|
129 |
-
|
130 |
-
// Set the old nicename.
|
131 |
-
// Note: This check is only for back-compat. You should pass a WP_User object.
|
132 |
-
if ( isset( $old_user_data->user_nicename ) ) {
|
133 |
-
$old_nicename = $old_user_data->user_nicename;
|
134 |
-
} else {
|
135 |
-
_doing_it_wrong( __FUNCTION__, ' The function ba_eas_update_nicename_cache() expects $old_user_data to be a WP_User object.', 'Edit Author Slug 1.0.4' );
|
136 |
-
$old_nicename = $old_user_data;
|
137 |
-
}
|
138 |
-
|
139 |
-
// Delete the old nicename from the cache.
|
140 |
-
wp_cache_delete( $old_nicename, 'userslugs' );
|
141 |
-
|
142 |
-
// Add the new nicename to the cache.
|
143 |
-
wp_cache_add( $new_nicename, $user_id, 'userslugs' );
|
144 |
}
|
43 |
* @since 1.2.0
|
44 |
* @deprecated 1.5.0
|
45 |
*
|
|
|
|
|
46 |
* @return WP_Roles
|
47 |
*/
|
48 |
function ba_eas_get_wp_roles() {
|
93 |
/**
|
94 |
* Clean and update the nicename cache.
|
95 |
*
|
|
|
|
|
|
|
96 |
* @since 1.0.0
|
97 |
+
* @since 1.6.1 Converted to a no-op.
|
98 |
* @deprecated 1.5.0
|
99 |
*
|
100 |
* @param int $user_id The user id.
|
102 |
* @param string $new_nicename The new user nicename.
|
103 |
*/
|
104 |
function ba_eas_update_nicename_cache( $user_id = 0, $old_user_data = '', $new_nicename = '' ) {
|
|
|
105 |
_deprecated_function( __FUNCTION__, '1.5.0', 'wp_cache_delete( $old_nicename, \'userslugs\' );' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
106 |
}
|
includes/functions.php
CHANGED
@@ -142,15 +142,6 @@ function ba_eas_auto_update_user_nicename( $user_id = 0, $bulk = false, $structu
|
|
142 |
// Add it back in case other plugins do some updating.
|
143 |
add_action( 'profile_update', 'ba_eas_auto_update_user_nicename' );
|
144 |
|
145 |
-
// Only delete the `userslugs` cache if the user was successfully updated.
|
146 |
-
// TODO: Remove when WP 4.5 is the minimum version.
|
147 |
-
// See https://core.trac.wordpress.org/ticket/35750.
|
148 |
-
if ( ! empty( $user_id ) && ! is_wp_error( $user_id ) ) {
|
149 |
-
|
150 |
-
// Delete the old nicename from the cache.
|
151 |
-
wp_cache_delete( $old_nicename, 'userslugs' );
|
152 |
-
}
|
153 |
-
|
154 |
return $user_id;
|
155 |
}
|
156 |
|
@@ -234,7 +225,7 @@ function ba_eas_auto_update_user_nicename_bulk( $do_bulk = false ) {
|
|
234 |
}
|
235 |
}
|
236 |
|
237 |
-
// If we have some when statements,
|
238 |
if ( ! empty( $when ) ) {
|
239 |
|
240 |
// Setup our when and where statements.
|
142 |
// Add it back in case other plugins do some updating.
|
143 |
add_action( 'profile_update', 'ba_eas_auto_update_user_nicename' );
|
144 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
145 |
return $user_id;
|
146 |
}
|
147 |
|
225 |
}
|
226 |
}
|
227 |
|
228 |
+
// If we have some when statements, then update the nicenames.
|
229 |
if ( ! empty( $when ) ) {
|
230 |
|
231 |
// Setup our when and where statements.
|
js/edit-author-slug.js
CHANGED
@@ -52,9 +52,11 @@
|
|
52 |
});
|
53 |
|
54 |
// When the custom author slug input is focused, set the custom radio as selected.
|
55 |
-
|
56 |
-
|
57 |
-
|
|
|
|
|
58 |
|
59 |
// Watch select boxes, and add a warning if username is selected, but
|
60 |
// only when iThemes `force unique nicename` is turned on.
|
52 |
});
|
53 |
|
54 |
// When the custom author slug input is focused, set the custom radio as selected.
|
55 |
+
if ( customInput ) {
|
56 |
+
customInput.addEventListener( 'focus', function() {
|
57 |
+
document.querySelector( '.eas-author-slug-custom-radio' ).checked = 'checked';
|
58 |
+
});
|
59 |
+
}
|
60 |
|
61 |
// Watch select boxes, and add a warning if username is selected, but
|
62 |
// only when iThemes `force unique nicename` is turned on.
|
js/edit-author-slug.min.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1 |
-
/*! edit-author-slug - v1.6.
|
2 |
!function(){var c;c=function(e){e.classList.toggle("hidden")},document.addEventListener("DOMContentLoaded",function(){var t=document.querySelector('input[name="ba_eas_author_slug_custom"]'),e=document.querySelector(".eas-demo-author-base-front"),n=document.querySelector('input[name="_ba_eas_remove_front"]');n&&(n.checked&&c(e),n.addEventListener("click",function(){c(e)})),document.querySelectorAll('input[class="eas-checkbox"]').forEach(function(e){var t=e.parentNode.parentNode.nextElementSibling;e.checked||c(t),e.addEventListener("click",function(){c(t)})}),document.querySelectorAll('input[name="ba_eas_author_slug"]').forEach(function(e){e.addEventListener("click",function(){e.classList.contains("eas-author-slug-custom-radio")||(t.value=e.value)})}),t&&t.addEventListener("focus",function(){document.querySelector(".eas-author-slug-custom-radio").checked="checked"}),document.querySelectorAll("select").forEach(function(e){e.addEventListener("change",function(e){var t=e.target.nextElementSibling;t&&t.classList.contains("eas-author-slug-select-error")&&c(t)})})})}();
|
1 |
+
/*! edit-author-slug - v1.6.1 - 2019-09-05 5:58:43 AM UTC - https://github.com/thebrandonallen/edit-author-slug/ */
|
2 |
!function(){var c;c=function(e){e.classList.toggle("hidden")},document.addEventListener("DOMContentLoaded",function(){var t=document.querySelector('input[name="ba_eas_author_slug_custom"]'),e=document.querySelector(".eas-demo-author-base-front"),n=document.querySelector('input[name="_ba_eas_remove_front"]');n&&(n.checked&&c(e),n.addEventListener("click",function(){c(e)})),document.querySelectorAll('input[class="eas-checkbox"]').forEach(function(e){var t=e.parentNode.parentNode.nextElementSibling;e.checked||c(t),e.addEventListener("click",function(){c(t)})}),document.querySelectorAll('input[name="ba_eas_author_slug"]').forEach(function(e){e.addEventListener("click",function(){e.classList.contains("eas-author-slug-custom-radio")||(t.value=e.value)})}),t&&t.addEventListener("focus",function(){document.querySelector(".eas-author-slug-custom-radio").checked="checked"}),document.querySelectorAll("select").forEach(function(e){e.addEventListener("change",function(e){var t=e.target.nextElementSibling;t&&t.classList.contains("eas-author-slug-select-error")&&c(t)})})})}();
|
languages/edit-author-slug.pot
CHANGED
@@ -1,16 +1,16 @@
|
|
1 |
-
# Copyright (C) 2009-
|
2 |
# This file is distributed under the same license as the Edit Author Slug package.
|
3 |
# Submit translations to https://translate.wordpress.org/projects/wp-plugins/edit-author-slug.
|
4 |
msgid ""
|
5 |
msgstr ""
|
6 |
-
"Project-Id-Version: Edit Author Slug 1.6.
|
7 |
"Report-Msgid-Bugs-To: "
|
8 |
"https://github.com/thebrandonallen/edit-author-slug/issues\n"
|
9 |
-
"POT-Creation-Date:
|
10 |
"MIME-Version: 1.0\n"
|
11 |
"Content-Type: text/plain; charset=utf-8\n"
|
12 |
"Content-Transfer-Encoding: 8bit\n"
|
13 |
-
"PO-Revision-Date:
|
14 |
"Last-Translator: BRANDON ALLEN <plugins@brandonallen.me>\n"
|
15 |
"Language-Team: ENGLISH <plugins@brandonallen.me>\n"
|
16 |
"Language: en\n"
|
@@ -24,7 +24,7 @@ msgstr ""
|
|
24 |
"X-Poedit-SearchPath-0: .\n"
|
25 |
"X-Poedit-Bookmarks: \n"
|
26 |
"X-Textdomain-Support: yes\n"
|
27 |
-
"X-Generator: grunt-wp-
|
28 |
|
29 |
#: includes/admin.php:74
|
30 |
msgid ""
|
@@ -36,7 +36,7 @@ msgstr ""
|
|
36 |
msgid "ie. - 'user-name', 'firstname-lastname', or 'master-ninja'"
|
37 |
msgstr ""
|
38 |
|
39 |
-
#: includes/admin.php:77 includes/admin.php:79 includes/admin.php:
|
40 |
msgid "Author Slug"
|
41 |
msgstr ""
|
42 |
|
@@ -85,77 +85,77 @@ msgid ""
|
|
85 |
"something different."
|
86 |
msgstr ""
|
87 |
|
88 |
-
#: includes/admin.php:
|
89 |
msgid "Edit Author Slug Settings"
|
90 |
msgstr ""
|
91 |
|
92 |
-
#: includes/admin.php:
|
93 |
msgid "Author Base"
|
94 |
msgstr ""
|
95 |
|
96 |
-
#: includes/admin.php:
|
97 |
msgid "Remove Front"
|
98 |
msgstr ""
|
99 |
|
100 |
-
#: includes/admin.php:
|
101 |
msgid "Role-Based Author Base"
|
102 |
msgstr ""
|
103 |
|
104 |
-
#: includes/admin.php:
|
105 |
msgid "Role Slugs"
|
106 |
msgstr ""
|
107 |
|
108 |
-
#: includes/admin.php:
|
109 |
msgid "Automatic Author Slug Creation"
|
110 |
msgstr ""
|
111 |
|
112 |
-
#: includes/admin.php:
|
113 |
msgid "Automatically Update"
|
114 |
msgstr ""
|
115 |
|
116 |
-
#: includes/admin.php:
|
117 |
msgid "Author Slug Structure"
|
118 |
msgstr ""
|
119 |
|
120 |
-
#: includes/admin.php:
|
121 |
msgid "Bulk Update Author Slugs"
|
122 |
msgstr ""
|
123 |
|
124 |
-
#: includes/admin.php:
|
125 |
msgid "Bulk Update"
|
126 |
msgstr ""
|
127 |
|
128 |
-
#: includes/admin.php:
|
129 |
msgid "Change your author base to something more fun!"
|
130 |
msgstr ""
|
131 |
|
132 |
-
#: includes/admin.php:
|
133 |
msgid ""
|
134 |
"Allow Author Slugs to be automatically updated, and set the default Author "
|
135 |
"Slug structure for users. Automatic updating will only occur when a user "
|
136 |
"can't edit Author Slugs on their own."
|
137 |
msgstr ""
|
138 |
|
139 |
-
#: includes/admin.php:
|
140 |
msgid ""
|
141 |
"This could have SEO repercussions if users update their profiles "
|
142 |
"frequently, and it will override any manual editing of the Author Slug you "
|
143 |
"may have previously completed."
|
144 |
msgstr ""
|
145 |
|
146 |
-
#: includes/admin.php:
|
147 |
msgid "Defaults to 'author'"
|
148 |
msgstr ""
|
149 |
|
150 |
-
#: includes/admin.php:
|
151 |
msgid "Remove the \"front\" portion of the author permalink structure."
|
152 |
msgstr ""
|
153 |
|
154 |
-
#: includes/admin.php:
|
155 |
msgid "Set user's Author Base according to their role."
|
156 |
msgstr ""
|
157 |
|
158 |
-
#: includes/admin.php:
|
159 |
#. translators: 1: rewrite tag, 2: rewrite tag demo usage, 3: demo URL using
|
160 |
#. rewrite tag
|
161 |
msgid ""
|
@@ -164,65 +164,65 @@ msgid ""
|
|
164 |
"something like \"%3$s\"."
|
165 |
msgstr ""
|
166 |
|
167 |
-
#: includes/admin.php:
|
168 |
msgid "Automatically update Author Slug when a user updates their profile."
|
169 |
msgstr ""
|
170 |
|
171 |
-
#: includes/admin.php:
|
172 |
msgid "Default author slug options"
|
173 |
msgstr ""
|
174 |
|
175 |
-
#: includes/admin.php:
|
176 |
msgid "Update all users at once based on the specified Author Slug structure."
|
177 |
msgstr ""
|
178 |
|
179 |
-
#: includes/admin.php:
|
180 |
msgid ""
|
181 |
"Update all users according to the below Author Slug setting. This will only "
|
182 |
"be run after clicking \"Save Changes\"."
|
183 |
msgstr ""
|
184 |
|
185 |
-
#: includes/admin.php:
|
186 |
msgid "Default bulk update author slug options"
|
187 |
msgstr ""
|
188 |
|
189 |
-
#: includes/admin.php:
|
190 |
msgid "Settings"
|
191 |
msgstr ""
|
192 |
|
193 |
-
#: includes/admin.php:
|
194 |
msgid "username (Default)"
|
195 |
msgstr ""
|
196 |
|
197 |
-
#: includes/admin.php:
|
198 |
msgid "nickname"
|
199 |
msgstr ""
|
200 |
|
201 |
-
#: includes/admin.php:
|
202 |
msgid "displayname"
|
203 |
msgstr ""
|
204 |
|
205 |
-
#: includes/admin.php:
|
206 |
msgid "firstname"
|
207 |
msgstr ""
|
208 |
|
209 |
-
#: includes/admin.php:
|
210 |
msgid "lastname"
|
211 |
msgstr ""
|
212 |
|
213 |
-
#: includes/admin.php:
|
214 |
msgid "firstname-lastname"
|
215 |
msgstr ""
|
216 |
|
217 |
-
#: includes/admin.php:
|
218 |
msgid "lastname-firstname"
|
219 |
msgstr ""
|
220 |
|
221 |
-
#: includes/admin.php:
|
222 |
msgid "userid"
|
223 |
msgstr ""
|
224 |
|
225 |
-
#: includes/admin.php:
|
226 |
msgid "hash"
|
227 |
msgstr ""
|
228 |
|
@@ -234,7 +234,7 @@ msgstr ""
|
|
234 |
msgid "Use class constant, BA_Edit_Author_Slug::DB_VERSION, instead."
|
235 |
msgstr ""
|
236 |
|
237 |
-
#: includes/functions.php:
|
238 |
#. translators: Updated author slugs count.
|
239 |
msgid "%d user author slug updated."
|
240 |
msgid_plural "%d user author slugs updated."
|
1 |
+
# Copyright (C) 2009-2019 Brandon Allen
|
2 |
# This file is distributed under the same license as the Edit Author Slug package.
|
3 |
# Submit translations to https://translate.wordpress.org/projects/wp-plugins/edit-author-slug.
|
4 |
msgid ""
|
5 |
msgstr ""
|
6 |
+
"Project-Id-Version: Edit Author Slug 1.6.1\n"
|
7 |
"Report-Msgid-Bugs-To: "
|
8 |
"https://github.com/thebrandonallen/edit-author-slug/issues\n"
|
9 |
+
"POT-Creation-Date: 2019-09-05 05:58:44+00:00\n"
|
10 |
"MIME-Version: 1.0\n"
|
11 |
"Content-Type: text/plain; charset=utf-8\n"
|
12 |
"Content-Transfer-Encoding: 8bit\n"
|
13 |
+
"PO-Revision-Date: 2019-MO-DA HO:MI+ZONE\n"
|
14 |
"Last-Translator: BRANDON ALLEN <plugins@brandonallen.me>\n"
|
15 |
"Language-Team: ENGLISH <plugins@brandonallen.me>\n"
|
16 |
"Language: en\n"
|
24 |
"X-Poedit-SearchPath-0: .\n"
|
25 |
"X-Poedit-Bookmarks: \n"
|
26 |
"X-Textdomain-Support: yes\n"
|
27 |
+
"X-Generator: grunt-wp-i18n 1.0.3\n"
|
28 |
|
29 |
#: includes/admin.php:74
|
30 |
msgid ""
|
36 |
msgid "ie. - 'user-name', 'firstname-lastname', or 'master-ninja'"
|
37 |
msgstr ""
|
38 |
|
39 |
+
#: includes/admin.php:77 includes/admin.php:79 includes/admin.php:323
|
40 |
msgid "Author Slug"
|
41 |
msgstr ""
|
42 |
|
85 |
"something different."
|
86 |
msgstr ""
|
87 |
|
88 |
+
#: includes/admin.php:409 includes/admin.php:428
|
89 |
msgid "Edit Author Slug Settings"
|
90 |
msgstr ""
|
91 |
|
92 |
+
#: includes/admin.php:452 includes/admin.php:460
|
93 |
msgid "Author Base"
|
94 |
msgstr ""
|
95 |
|
96 |
+
#: includes/admin.php:474
|
97 |
msgid "Remove Front"
|
98 |
msgstr ""
|
99 |
|
100 |
+
#: includes/admin.php:485
|
101 |
msgid "Role-Based Author Base"
|
102 |
msgstr ""
|
103 |
|
104 |
+
#: includes/admin.php:495
|
105 |
msgid "Role Slugs"
|
106 |
msgstr ""
|
107 |
|
108 |
+
#: includes/admin.php:505
|
109 |
msgid "Automatic Author Slug Creation"
|
110 |
msgstr ""
|
111 |
|
112 |
+
#: includes/admin.php:513
|
113 |
msgid "Automatically Update"
|
114 |
msgstr ""
|
115 |
|
116 |
+
#: includes/admin.php:523 includes/admin.php:554
|
117 |
msgid "Author Slug Structure"
|
118 |
msgstr ""
|
119 |
|
120 |
+
#: includes/admin.php:536
|
121 |
msgid "Bulk Update Author Slugs"
|
122 |
msgstr ""
|
123 |
|
124 |
+
#: includes/admin.php:544
|
125 |
msgid "Bulk Update"
|
126 |
msgstr ""
|
127 |
|
128 |
+
#: includes/admin.php:573
|
129 |
msgid "Change your author base to something more fun!"
|
130 |
msgstr ""
|
131 |
|
132 |
+
#: includes/admin.php:586
|
133 |
msgid ""
|
134 |
"Allow Author Slugs to be automatically updated, and set the default Author "
|
135 |
"Slug structure for users. Automatic updating will only occur when a user "
|
136 |
"can't edit Author Slugs on their own."
|
137 |
msgstr ""
|
138 |
|
139 |
+
#: includes/admin.php:586
|
140 |
msgid ""
|
141 |
"This could have SEO repercussions if users update their profiles "
|
142 |
"frequently, and it will override any manual editing of the Author Slug you "
|
143 |
"may have previously completed."
|
144 |
msgstr ""
|
145 |
|
146 |
+
#: includes/admin.php:609
|
147 |
msgid "Defaults to 'author'"
|
148 |
msgstr ""
|
149 |
|
150 |
+
#: includes/admin.php:639
|
151 |
msgid "Remove the \"front\" portion of the author permalink structure."
|
152 |
msgstr ""
|
153 |
|
154 |
+
#: includes/admin.php:655
|
155 |
msgid "Set user's Author Base according to their role."
|
156 |
msgstr ""
|
157 |
|
158 |
+
#: includes/admin.php:661
|
159 |
#. translators: 1: rewrite tag, 2: rewrite tag demo usage, 3: demo URL using
|
160 |
#. rewrite tag
|
161 |
msgid ""
|
164 |
"something like \"%3$s\"."
|
165 |
msgstr ""
|
166 |
|
167 |
+
#: includes/admin.php:774
|
168 |
msgid "Automatically update Author Slug when a user updates their profile."
|
169 |
msgstr ""
|
170 |
|
171 |
+
#: includes/admin.php:802
|
172 |
msgid "Default author slug options"
|
173 |
msgstr ""
|
174 |
|
175 |
+
#: includes/admin.php:828
|
176 |
msgid "Update all users at once based on the specified Author Slug structure."
|
177 |
msgstr ""
|
178 |
|
179 |
+
#: includes/admin.php:845
|
180 |
msgid ""
|
181 |
"Update all users according to the below Author Slug setting. This will only "
|
182 |
"be run after clicking \"Save Changes\"."
|
183 |
msgstr ""
|
184 |
|
185 |
+
#: includes/admin.php:873
|
186 |
msgid "Default bulk update author slug options"
|
187 |
msgstr ""
|
188 |
|
189 |
+
#: includes/admin.php:910
|
190 |
msgid "Settings"
|
191 |
msgstr ""
|
192 |
|
193 |
+
#: includes/admin.php:937 tests/test-admin.php:1112
|
194 |
msgid "username (Default)"
|
195 |
msgstr ""
|
196 |
|
197 |
+
#: includes/admin.php:938 tests/test-admin.php:1113
|
198 |
msgid "nickname"
|
199 |
msgstr ""
|
200 |
|
201 |
+
#: includes/admin.php:939 tests/test-admin.php:1114
|
202 |
msgid "displayname"
|
203 |
msgstr ""
|
204 |
|
205 |
+
#: includes/admin.php:940 tests/test-admin.php:1115
|
206 |
msgid "firstname"
|
207 |
msgstr ""
|
208 |
|
209 |
+
#: includes/admin.php:941 tests/test-admin.php:1116
|
210 |
msgid "lastname"
|
211 |
msgstr ""
|
212 |
|
213 |
+
#: includes/admin.php:942 tests/test-admin.php:1117
|
214 |
msgid "firstname-lastname"
|
215 |
msgstr ""
|
216 |
|
217 |
+
#: includes/admin.php:943 tests/test-admin.php:1118
|
218 |
msgid "lastname-firstname"
|
219 |
msgstr ""
|
220 |
|
221 |
+
#: includes/admin.php:944 tests/test-admin.php:1119
|
222 |
msgid "userid"
|
223 |
msgstr ""
|
224 |
|
225 |
+
#: includes/admin.php:945 tests/test-admin.php:1120
|
226 |
msgid "hash"
|
227 |
msgstr ""
|
228 |
|
234 |
msgid "Use class constant, BA_Edit_Author_Slug::DB_VERSION, instead."
|
235 |
msgstr ""
|
236 |
|
237 |
+
#: includes/functions.php:259
|
238 |
#. translators: Updated author slugs count.
|
239 |
msgid "%d user author slug updated."
|
240 |
msgid_plural "%d user author slugs updated."
|
readme.txt
CHANGED
@@ -2,9 +2,9 @@
|
|
2 |
Contributors: thebrandonallen
|
3 |
Tags: author, author base, author slug, user nicename, nicename, permalink, permalinks, slug, users, user, role, roles
|
4 |
Requires at least: 4.7
|
5 |
-
Tested up to:
|
6 |
Requires PHP: 5.3
|
7 |
-
Stable tag: 1.6.
|
8 |
License: GPLv2 or later
|
9 |
License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
10 |
|
@@ -67,6 +67,12 @@ If this doesn't work, make sure you don't have any slug conflicts from other pos
|
|
67 |
|
68 |
== Changelog ==
|
69 |
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
= 1.6.0 =
|
71 |
* Release date: 2018-10-11
|
72 |
* Minimum required WordPress version is now 4.7
|
2 |
Contributors: thebrandonallen
|
3 |
Tags: author, author base, author slug, user nicename, nicename, permalink, permalinks, slug, users, user, role, roles
|
4 |
Requires at least: 4.7
|
5 |
+
Tested up to: 5.2.3
|
6 |
Requires PHP: 5.3
|
7 |
+
Stable tag: 1.6.1
|
8 |
License: GPLv2 or later
|
9 |
License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
10 |
|
67 |
|
68 |
== Changelog ==
|
69 |
|
70 |
+
= 1.6.1 =
|
71 |
+
* Release date: 2019-09-05
|
72 |
+
* Removes pre-WP 4.5 cache busting. The minimum version has been 4.7 for quite some time, and, as of WP 4.5, the cache busting was redundant.
|
73 |
+
* Don't show the options page if `ba_eas_can_edit_author_slug()` returns `false`.
|
74 |
+
* Bumps "Tested up to" version to 5.2.3
|
75 |
+
|
76 |
= 1.6.0 =
|
77 |
* Release date: 2018-10-11
|
78 |
* Minimum required WordPress version is now 4.7
|