404にはなりますが、確かにユーザー名が出ますね。
未検証ですが、下記のような解決方法を見つけました。(明日試してみます)
PHP
1add_filter( 'author_rewrite_rules', '__return_empty_array' );
2function disable_author_archive() {
3 if( $_GET[ 'author' ] || preg_match( '#/author/.+#', $_SERVER[ 'REQUEST_URI' ] ) ){
4 wp_redirect( home_url( '/404.php' ) );
5 exit;
6 }
7}
8add_action( 'init', 'disable_author_archive' );
【投稿者アーカイブを無効化してWordPressのユーザ名を隠す方法 | ウェブコンテンツウェブコンテンツ】
http://www.webcontent.jp/no-author-archive/
追記:
投稿者アーカイブが利用できなくなるのは避けたいので、
author/admin ではなく author/1 にリダイレクトする
これでは?
PHP
1function only_my_author_archive() {
2 if( $_GET[ 'author' ] && $_GET[ 'author' ] > 0 ){
3 wp_redirect( home_url( '/author/'.intval( $_GET[ 'author' ] ) ) );
4 exit;
5 }
6}
7add_action( 'init', 'only_my_author_archive' );
追記2:
カノニカル時に利用されているであろう '%author%' を使っている(記述がある)のが get_author_posts_url
get_permalink
の2つのみで、「Edit_Author_Slug」が使用しているのが get_author_posts_url
内の author_link
フックなので、ひとまずこれでいけそう。
PHP
1add_filter( 'author_rewrite_rules', '__return_empty_array' );
2function my_author_link( $link = '', $user_id = 0 ) {
3 if ( $user_id > 0 ) {
4 $link = home_url( user_trailingslashit( '/author/'.$user_id ) );
5 }
6 // Return the link.
7 return $link;
8}
9add_filter( 'author_link', 'my_author_link', 20, 2 );
(参考)
【get_author_posts_url() | Function | WordPress Developer Resources】
https://developer.wordpress.org/reference/functions/get_author_posts_url/
【get_permalink() | Function | WordPress Developer Resources】
https://developer.wordpress.org/reference/functions/get_permalink/
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2016/04/18 15:33
2016/04/18 16:11
2016/04/18 17:19
2016/04/18 17:33
2016/04/18 17:45
2016/04/19 07:16
2016/04/19 09:17
2016/04/19 12:03
2016/04/19 13:38
2016/04/19 14:50 編集
2016/04/19 14:20
2016/04/19 15:36
2016/04/20 06:00
2016/04/20 06:42
2016/04/20 17:02
2016/04/21 10:21
2016/04/21 16:32 編集