別の人が作成した Web サイトの保守を開始しました。カスタム投稿タイプに適用される書き換えルールを変更するのが好きです。
より具体的には、カスタム投稿タイプは次の設定で作成されます:
$args = array(
...
'rewrite' => array(
'slug' => 'myposttype',
'with_front' => false
),
....
)
register_post_type('myposttype', $args);
パーマリンクの構造は次のとおりです。
Post name http://www.mysite.gr/sample-post/
ただし、URL 構造は次のとおりです。
http://www.mysite.gr/myposttype/my_post_slug/
どうすれば変更できますか
http://www.mysite.gr/my_post_slug/
任意のアイデアをお願いします?