WP PLUGIN 修正(カスタムフィールド追加)

・ソートのカスタムフィールドを4つに変更
・配列の初期化書式を書き換え
・ソートのカスタムフィールドを4つに変更
・ソートのJSでカスタムフィールドをdisabledにしないよう変更
This commit is contained in:
2021-05-15 16:43:56 +09:00
parent 3e38f5f26f
commit 48148820cc
4 changed files with 53 additions and 82 deletions
-23
View File
@@ -16,7 +16,6 @@ jQuery(function ($) {
change_search_per_page();
change_tax_per_page();
change_custom_field_sort();
change_normal_field_sort();
function change_tab_menu() {
@@ -143,28 +142,6 @@ jQuery(function ($) {
});
}
function change_custom_field_sort() {
let s_box = $('.sort_box');
let custom_field_check = $('.custom_field_check');
s_box.find(custom_field_check).each(function () {
if ($(this).prop('checked') == false) {
$(this).parents('.product-list-sort-type').find('.custom_field_key').prop('disabled', true);
$(this).parents('.product-list-sort-type').find('.custom_field_meta_value').prop('disabled', true);
}
});
custom_field_check.on('click', function () {
if ($(this).prop('checked') == true) {
$(this).parents('.product-list-sort-type').find('.custom_field_key').prop('disabled', false);
$(this).parents('.product-list-sort-type').find('.custom_field_meta_value').prop('disabled', false);
} else {
$(this).parents('.product-list-sort-type').find('.custom_field_key').val('').prop('disabled', true);
$(this).parents('.product-list-sort-type').find('.custom_field_meta_value').prop('disabled', true);
}
})
}
function change_normal_field_sort() {
let s_box = $('.sort_box');
let targets = '.custom_field_check, .sort_date_check, .sort_title_check, .sort_ID_check, .sort_modified_check';