Files
profile/assets/js/admin/editphp-inline-edit-tax-radio-hack.js
Andrey Kuvshinov 8fc8cbae32 add files
2025-07-09 21:21:17 +03:00

28 lines
904 B
JavaScript

jQuery(document).ready(function($) {
var taxonomy = 'category',
post_id = null,
term_id = null,
li_ele_id = null;
$('.editinline').on('click', function() {
post_id = inlineEditPost.getId(this);
$.ajax({
url: ajaxurl,
data: {
'action': 'wpse_139269_inline_edit_radio_checked_hack',
'ajax-taxonomy': taxonomy,
'ajax-post-id': post_id
},
type: 'POST',
dataType: 'json',
success: function (response) {
term_id = response;
li_ele_id = 'in-' + taxonomy + '-' + term_id;
$( 'input[id="'+li_ele_id+'"]' ).attr( 'checked', 'checked' );
},
error: function (response){
//console.log(response);
}
});
});
});