WP PLUGIN アーカイブ毎に投稿表示順を設定する

・ベース部分(カテゴリー、投稿)の表示順用カスタムフィールド設定登録の作成
This commit is contained in:
2021-05-03 18:51:02 +09:00
commit 2ed2b25194
15 changed files with 486 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
jQuery(function ($) {
let cat_ul_count = $('.post-order-list').length; //カテゴリ総数
for (let i = 0; i < cat_ul_count; i++) {
let my_list = $('.post-order-list:eq(' + i + ')');
my_list.sortable(
{
update: function () {
let list_count = $('.product-list', my_list).length;
for (let j = 0; j < list_count; j++) {
let list_order = j + 1;
$('.list_order:eq(' + j + ')', my_list).val(list_order);
$('.list_order:eq(' + j + ')', my_list).siblings('.sort-num-label').text(list_order);
}
}
}
);
my_list.disableSelection();
}
});