This is one that I've been fiddling with, but since I have no idea what I'm doing, I'm not getting very far.
By default, the Author page is located at http://www.mydomain.com/author/author username]
Unfortunately, when using E-mail Addresses as your WordPress username, the author name gets a little long ([firstname][lastname][mydomaincom]). What I would like to do is instead use a combination of the First and Last Name of the Author to construct the permalink/url or use the Author Nickname field instead.
From a previous post, I can see where you can modify the slug used for authors in rewrite.php (located in wp-includes)...
class WP_Rewrite {
var $permalink_structure;
var $use_trailing_slashes;
var $category_base;
var $tag_base;
var $category_structure;
var $tag_structure;
var $author_base = 'author';
var $author_structure;
...
Sadly, that just results in 404 errors after making changes to that slug, so we'll move on. Next, I can see where the author permalink is created in that same file...
function get_author_permastruct() {
if (isset($this->author_structure)) {
return $this->author_structure;
}
if (empty($this->permalink_structure)) {
$this->author_structure = '';
return false;
}
... but I can't really can't make anything out of that.
Finally, I noticed another file called author-template.php (also in wp-includes) that gave a little more insight on how the permalink is constructed...
function get_author_posts_url($author_id, $author_nicename = '') {
global $wpdb, $wp_rewrite, $post;
$auth_ID = (int) $author_id;
$link = $wp_rewrite->get_author_permastruct();
if ( empty($link) ) {
$file = get_option('home') . '/';
$link = $file . '?author=' . $auth_ID;
} else {
if ( '' == $author_nicename ) {
$user = get_userdata($author_id);
if ( !empty($user->user_nicename) )
$author_nicename = $user->user_nicename;
}
$link = str_replace('%author%', $author_nicename, $link);
$link = get_option('home') . trailingslashit($link);
}
$link = apply_filters('author_link', $link, $author_id, $author_nicename);
return $link;
}
... but once again, I have no idea what I'm looking at. Any thoughts and suggestions into this would be grateful. Thanks in advance!