Role specific author slug
-
Hey, It would be great if you can add support for creating role specific author slug – and thereby also including custom roles.
Great plugin though!
-
Thanks for the comment and suggestion. Sorry it took so long to respond. I’ve been, slowly, working on role-based author bases. I’ve got the code base stable now, so if you’re interested, I’d love for you to test it out before I release the new version. Use the link below to download a zip file of 1.0 Beta 1. After extraction, you’ll have to rename the folder to edit-author-slug, and upload via ftp. I shouldn’t have to worry, but as always, make sure you backup your database first π
https://github.com/thebrandonallen/edit-author-slug/archive/role-based-author-base.zip
HI Brandon
Plugin is working great.Now .. Now can we use Role specific template ?
e.g. If I create new role player, then my Role specific author slug will be …/player/…
Now I want to show different page for this player.
thta means I want to use player.php instead of author.phpHow can? Thanks in advance.
Hi,
The new beta of your plugin is looking great! Just what I needed. However, when I want to create a user after I enabled the plugin it gives me a “Are you sure you want to do this?” and it doesn’t create the user. Is there any way we can debug this? I would love to help out.
Getting the same problem as wgroenewold
“Are you sure you want to do this”@wgroenewold and @pawarsac Good catch. Thanks for the report. See link below for fixed version.
@pawarsac I hadn’t thought about templates. Easy enough to impplement, so, wish granted. Here’s how it works. If there’s no template matching author-{user_nicename}.php or author-{user_id}.php, then the plugin will look for author-{role}.php, followed by author-{role_slug}.php. If none of the above are found, then it will fall back to author.php, as always. For most people
rolewill equalrole_slug, but since you can change the role_slug, I thought it best to look for both. In your example, you would create a template named author-player.php. Link below contains code for role-based author templates as well. I really didn’t test it, so feedback, broken or working, would be much appreciated.Here’s a link to download 1.0-RC2
http://downloads.wp.xz.cn/plugin/edit-author-slug.zip@brandon “Are you sure you want to do this” has gone away. Thanks.
I created author-player.php in working theme but ‘Role based template’ thing not working.@pawarsac How about a if statement on the beginning of the template to check which role is active and then do your template-specific things?
@wgroenewold , we already did the same π
@brandon Allen Thank you so much for the quick fix, will try to implement it on Monday!
I created author-player.php in working theme but ‘Role based template’ thing not working.
@pawarsac Yep, that happened. I left out a very important line of code that makes it work. If you add the following line to the bottom of the edit-author-slug/includes/hooks.php file it will get things in order, or you can wait until I push out an update with the fix later on today.
add_filter( 'author_template', 'ba_eas_template_include' );1.0-RC3 is up with all the fixes mentioned above, plus the code to actually make the role-based author templates work.
http://downloads.wp.xz.cn/plugin/edit-author-slug.zip
@pawarsac and @wgroenewold Thanks for testing things out and providing feedback!
@brandon Allen A lot Thanks. Plugin Working fine. Will update you if any bug occurs.
Awesomesauce! Looking great. I’m already looking forward to implement this in all my projects.
@pawarsac and @wgroenewold I’ve just released 1.0. There were no changes between 1.0 and 1.0-RC3. Thanks again for your help with testing!
hmm, I got this going but for some reason it’s seeing the template but not the CSS file? So I have no CSS for my role based template?
The topic ‘Role specific author slug’ is closed to new replies.