add files
This commit is contained in:
28
assets/js/admin/editphp-inline-edit-tax-radio-hack.js
Normal file
28
assets/js/admin/editphp-inline-edit-tax-radio-hack.js
Normal file
@@ -0,0 +1,28 @@
|
||||
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);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user