登録された分類法(wps_type)と2つのカスタム投稿タイプ(wps_business、wps_location)がこの順序であります。登録された分類法では、書き換え引数がslug => typeに設定されており、posttypesではslug=> business&slug=>locationがすでに設定されています。次のすべてが利用できるカスタムスマートパーマリンク書き換えルールが必要です。
デフォルトは機能します(そしてまだ機能する必要があります):
http://domain.com/post-type/post-name => http://domain.com/business/post-name
http://domain.com/post-type/post-name => http://domain.com/location/post-name
http://domain.com/taxonomy/term-name => http://domain.com/type/term-name
しかし、私が必要としているのは:
http://domain.com/post-type/taxonomy => http://domain.com/location-post-name/type-term-name
したがって、post_type_linkフィルターを使用しても機能しない可能性があると思いますが、間違っている可能性があります。これが私が試したいくつかのコードです:
add_rewrite_rule( '^directory/([^/]*)/([^/]*)/?', 'index.php?wps_location=$matches[1]&wps_business=$matches[2]', 'top' );
add_rewrite_tag( '%wps_location%', '([^/]+)' );
add_rewrite_tag( '%wps_business_types%', '([^&]+)' );