-
Notifications
You must be signed in to change notification settings - Fork 3
[カスタム分類リスト ウィジェット ] 昇順・降順を指定できるようにする #1116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@MasayaMORIMOTO @kurudrive @mthaichi |
@akito-38 |
@akito-38 @MasayaMORIMOTO |
@akito-38 @MasayaMORIMOTO .org に登録してる無料プラグインに関しては翻訳は .org 上で行うので、リポジトリでは翻訳しなくてOKですーん(・w・ |
@akito-38
|
@drill-lancer https://rishuntrading.co.jp/blog/php/sort_post_type_data/ 'title' タイトルでソート とあります。 |
今回並び替えの対象となるのは投稿ではなくカテゴリ・タグ・カスタム分類(以下、タクソノミー)の中の分類項目(以下、ターム)です。 ややこしいですが、投稿を並び替えるものとタクソノミーを並び替えるのは渡すものが違います。 P.S. |
'hierarchical' => true, | ||
'title_li' => '', | ||
'taxonomy' => $instance['tax_name'], | ||
'orderby' => 'title', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RICKさんご指摘の通り、
https://rishuntrading.co.jp/blog/php/sort_post_type_data/
の記事は投稿の並び替えの解説で、
今回はカテゴリーを取得する wp_list_categories() で、
wp_list_categories() の場合は タイトル順は name, slug 順は slug を使う感じなので、name の方が無難かなと。
https://developer.wordpress.org/reference/classes/wp_term_query/get_terms/
'orderby' => 'title', | |
'orderby' => 'name', |
'taxonomy' => $instance['tax_name'], | ||
'name' => $name, | ||
'value_field' => 'slug', | ||
'orderby' => 'title', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'orderby' => 'title', | |
'orderby' => 'name', |
@drill-lancer @kurudrive |
チケットへのリンク / 変更の理由(元のissueがあればリンクを貼り付ければOK)
#1115
どういう変更をしたか?
[ VK カテゴリー / カスタム分類リスト ウィジェット ] 昇順・降順を指定できるようにしました。
ソースコードについて
デザイン・UI
プログラムの変更の場合
テストを書かないのは普通ではありません。書けるテストは極力書くようにしてください。
書いていない場合は書かない理由を記載してください。
→ スキップ。
その他
変更内容について何を確認したか、どういう方法で確認をしたかなど
WP管理画面の外観→ウィジェットでVK カテゴリー/カスタム分類リストを設置する。
一番下の項目に「Display order」がある事を確認する。
ascending order(昇順)、descending order(降順)で正しく並び順が変わるか確認する。
フロント側でも同じように動作するか確認。
レビュワーの確認方法・確認する内容など
実装者と同じ確認をお願いいたします。
レビュワーに回す前の確認事項
レビュワー向け
確認して変更が反映されていない場合の確認事項