回答:
これを行うことを発見した2つの方法があります。
最初の方法は実装がより簡単ですが、すべての状況で機能するとは限りません(そのうちの1つについてはすぐに説明します)。
数日前にこのソリューションを見つけました:URL Rewriting
そして、コメント付きのコードを次に示します。
// Define the author levels you want to use
$custom_author_levels = array( 'user', 'leader' );
// On init, add a new author_level rewrite tag and add it to the author_base property of wp_rewrite
add_action( 'init', 'wpleet_init' );
function wpleet_init()
{
    global $wp_rewrite;
    $author_levels = $GLOBALS['custom_author_levels'];
    // Define the tag and use it in the rewrite rule
    add_rewrite_tag( '%author_level%', '(' . implode( '|', $author_levels ) . ')' );
    $wp_rewrite->author_base = '%author_level%';
}
// The previous function creates extra author_name rewrite rules that are unnecessary.  
//This function tests for and removes them
add_filter( 'author_rewrite_rules', 'wpleet_author_rewrite_rules' );
function wpleet_author_rewrite_rules( $author_rewrite_rules )
{
    foreach ( $author_rewrite_rules as $pattern => $substitution ) {
        if ( FALSE === strpos( $substitution, 'author_name' ) ) {
            unset( $author_rewrite_rules[$pattern] );
        }
    }
    return $author_rewrite_rules;
}
次に、組み込みのauthor.phpテンプレートを使用して、心のコンテンツを変更できます。
Jan Fabryがすべてを説明する素晴らしい仕事をしているので、心から、上記のリンクをチェックしてください。
これらのソリューションの発見中に取り組んでいたテーマについては、ユーザーメタ値(別のID)に基づいてカスタムページを提供する必要がありました。クライアントはユーザー名またはユーザーIDを公開することを望まなかったため、別のレイヤーを作成しました。
唯一の問題?現時点では、Rewrite APIを使用してメタキー/値でクエリを実行する方法は明確ではありません。幸いなことに、解決策がありました。
functions.phpファイルで...
// Create the query var so that WP catches your custom /user/username url
add_filter( 'query_vars', 'wpleet_rewrite_add_var' );
function wpleet_rewrite_add_var( $vars )
{
    $vars[] = 'user';
    return $vars;
}
次に、新しいクエリ変数をいつどのように処理するかを認識できるように、新しい書き換えタグとルールを作成する必要があります。
add_rewrite_tag( '%user%', '([^&]+)' );
add_rewrite_rule(
    '^user/([^/]*)/?',
    'index.php?user=$matches[1]',
    'top'
);
これを実行したら、クエリ変数が提供されているときに「キャッチ」するだけで、選択したテンプレートにリダイレクトできます。
add_action( 'template_redirect', 'wpleet_rewrite_catch' );
function wpleet_rewrite_catch()
{
    global $wp_query;
    if ( array_key_exists( 'user', $wp_query->query_vars ) ) {
        include (TEMPLATEPATH . '/user-profile.php');
        exit;
    }
}
user-profile.phpを作成したことを確認してください。
私の例では、$ wpdb-> usermetaテーブルを介して実際のuser_idに「パブリックユーザーID」を一致させる3番目の関数を作成し、その情報をテンプレートに渡しました。
テーマの他の部分とは異なるテンプレートを作成する必要がある場合は、get_headerを使用して名前を指定できることに注意してください。
get_header( 'user' );これはheader-user.phpファイルを呼び出します。
これらは両方とも、有効で実用的なソリューションです。2番目は、他の人がプロファイルを閲覧できる場合、ユーザーIDまたはユーザー名を公開しないため、「セキュリティ」の別のレイヤーを提供します。
お役に立てば幸いです。質問がある場合はお知らせください。
今日これを見つけて、template_redirectを使用する代わりにリクエストを変更して静的ページを表示するという違いで、@ bybloggersコードにいくつかの修正を加えました。つまり、ページテンプレートに好きなものを追加して、ページ。
class ProfilePage {
function __construct() {
    add_filter( 'init',array($this,'rw_init'));
    add_filter( 'query_vars', array($this,'wpleet_rewrite_add_var') );
    add_filter( 'request', array($this,'change_requests'));
}
function wpleet_rewrite_add_var( $vars ) {
    $vars[] = 'usuario';
    return $vars;
}
function rw_init(){
    add_rewrite_tag( '%usuario%', '([^&]+)' );
    add_rewrite_rule(
        '^usuario/([^/]*)/?',
        'index.php?usuario=$matches[1]',
        'top'
    );
}
function change_requests($query_vars) {
    //go to a specific page when the usuario key is set
    $query_vars['page_id'] = isset($query_vars['usuario']) ? 7581 : $query_vars['page_id'];
    return $query_vars;
}
}
new ProfilePage();スペイン語-> usuario =ユーザー<-英語
get_page_by_path('page-slug')->IDます。また、使用のを忘れないでくださいflush_rewrite_rules:私は次のように追加したいので、add_action( 'after_switch_theme', 'flush_rewrite_rules' );
                    これは@bybloggersの答えに基づいた私の作業コードです(ちなみに)template_redirectフックを使用してからPHPを終了するべきではないことがわかりました
説明はこちら:https : //markjaquith.wordpress.com/2014/02/19/template_redirect-is-not-for-loading-templates/
したがって、template_includeフックを使用する必要があります。このフックを使用すると、リダイレクトおよび終了メソッドを使用する必要はありません。
もう1つの違いは、/ useridなしでwww.server.com/myaccountが必要だったことです。
これはコードです:
add_filter( 'query_vars', 'wp58683_userprofile_var' );
function wp58683_userprofile_var( $vars )
{
    $vars[] = 'myprofile';
    return $vars;
}
add_rewrite_tag( '%myprofile%', '([^&]+)' );
add_rewrite_rule(
    '^myprofile/?',
    'index.php?myprofile',
    'top'
);
add_action( 'template_include', 'wp58683_userprofile_page' );
function wp58683_userprofile_page($original_template)
{
    global $wp_query;
    if ( array_key_exists( 'myprofile', $wp_query->query_vars ) ) {
        if (is_user_logged_in() ){ 
            return TEMPLATEPATH . '/user-profile.php';
        }
    }
    else {
        return $original_template;
    }
}もう1つの方法は、プラグインにさらに興味のない機能がある場合でも、この組み込みのBuddypressを使用することです。