File: /disk001/machen/www/support/wp-content/plugins/echo-knowledge-base/js/public-the-content.js
'use strict';
jQuery(document).ready(function($) {
// get all article copies
let $articles_counter_class = $('.eckb-article-page-content-counter');
// check if we have issue
if ( $articles_counter_class.length < 2 ) {
return;
}
// prevent infinite loop
if ( typeof window.epkb_the_content_fix !== 'undefined' ) {
return;
}
window.epkb_the_content_fix = 1;
$.ajax({
type: 'POST',
dataType: 'json',
data: {
action: 'epkb_update_the_content_flag',
_wpnonce_epkb_ajax_action: epkb_the_content_i18n.nonce,
post_id: epkb_the_content_i18n.post_id
},
url: epkb_the_content_i18n.ajaxurl,
}).done(function (response) {
if (typeof response.error != 'undefined' && response.error) {
return;
}
// replace content щи the body
$.get( location.href ).success(function(data){
document.open();
document.write(data);
document.close();
});
});
});