Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/accelera.../template...
File: custom-amp-content-button.js
(function() {
[0] Fix | Delete
tinymce.PluginManager.add('ampforwp_tc_button', function( editor, url ) {
[1] Fix | Delete
editor.addButton( 'ampforwp_tc_button', {
[2] Fix | Delete
text: 'Copy The Content',
[3] Fix | Delete
icon: 'dashicons dashicons-clipboard',
[4] Fix | Delete
classes: 'ampforwp-copy-content-button ',
[5] Fix | Delete
tooltip: 'Visual Editor to AMP Editor',
[6] Fix | Delete
onclick: function() {
[7] Fix | Delete
if(wp.data === undefined){
[8] Fix | Delete
if(typeof tinymce.editors.content.getContent()!= undefined){
[9] Fix | Delete
editor.insertContent(tinymce.editors.content.getContent());
[10] Fix | Delete
}else{
[11] Fix | Delete
editor.insertContent(document.getElementById('content').value());
[12] Fix | Delete
}
[13] Fix | Delete
}else if(wp.data){
[14] Fix | Delete
if ( wp.data.select( "core/editor" ) != undefined && typeof wp.data.select( "core/editor" ).getEditedPostContent() != undefined ) {
[15] Fix | Delete
var wp_blocks = wp.data.select( "core/block-editor" ).getBlocks();
[16] Fix | Delete
var editedContent = '';
[17] Fix | Delete
for(var i=0;i<wp_blocks.length;i++){
[18] Fix | Delete
var client_id = wp_blocks[i].clientId;
[19] Fix | Delete
var name = wp_blocks[i].name;
[20] Fix | Delete
if((wp_blocks[i].originalContent=='' || wp_blocks[i].originalContent==undefined)){
[21] Fix | Delete
var con = jQuery("#block-"+client_id).find("div[data-block]:last").html();
[22] Fix | Delete
if(con==undefined){
[23] Fix | Delete
con = jQuery("div[data-block="+client_id+"]").html();
[24] Fix | Delete
}
[25] Fix | Delete
editedContent += con;
[26] Fix | Delete
}else{
[27] Fix | Delete
editedContent += wp_blocks[i].originalContent;
[28] Fix | Delete
}
[29] Fix | Delete
}
[30] Fix | Delete
editor.insertContent(editedContent);
[31] Fix | Delete
}
[32] Fix | Delete
else if( tinymce.editors.content && typeof tinymce.editors.content.getContent()!= undefined){
[33] Fix | Delete
editor.insertContent(tinymce.editors.content.getContent());
[34] Fix | Delete
}else{
[35] Fix | Delete
editor.insertContent(document.getElementById('content').value());
[36] Fix | Delete
}
[37] Fix | Delete
}
[38] Fix | Delete
}
[39] Fix | Delete
});
[40] Fix | Delete
});
[41] Fix | Delete
})();
[42] Fix | Delete
[43] Fix | Delete
jQuery(document).ready(function($) {
[44] Fix | Delete
$("#meta-checkbox").click(function(){
[45] Fix | Delete
ampforwp_check_custom_content_status($(this));
[46] Fix | Delete
});
[47] Fix | Delete
ampforwp_check_custom_content_status($("#meta-checkbox"));
[48] Fix | Delete
function ampforwp_check_custom_content_status(checker){
[49] Fix | Delete
if (checker.prop('checked')==true){
[50] Fix | Delete
// var onload_content = tinymce.get('ampforwp_custom_content_editor').getContent();
[51] Fix | Delete
$('.amp-editor-content').show();
[52] Fix | Delete
var content = document.getElementById('ampforwp_custom_content_editor').value;
[53] Fix | Delete
if(content !== ''){
[54] Fix | Delete
$('.amp-editor-content').hide();
[55] Fix | Delete
}
[56] Fix | Delete
}
[57] Fix | Delete
else{
[58] Fix | Delete
$('.amp-editor-content').hide();
[59] Fix | Delete
}
[60] Fix | Delete
}
[61] Fix | Delete
if(document.getElementById('ampforwp_custom_content_editor') && document.getElementById('meta-checkbox').checked){
[62] Fix | Delete
tinymce.get('ampforwp_custom_content_editor').on("keyup change paste",function(){
[63] Fix | Delete
var thisval = tinymce.get('ampforwp_custom_content_editor').getContent();
[64] Fix | Delete
if(thisval!=""){
[65] Fix | Delete
$('.amp-editor-content').hide();
[66] Fix | Delete
}else{
[67] Fix | Delete
$('.amp-editor-content').show();
[68] Fix | Delete
}
[69] Fix | Delete
if($("#meta-checkbox").prop('checked')==false){
[70] Fix | Delete
$('.amp-editor-content').show();
[71] Fix | Delete
$("#ampforwp-amp-content-error-msg").html('Please select the "<b>Use This Content as AMP Content</b>" checkbox above before update.');
[72] Fix | Delete
if(thisval==""){
[73] Fix | Delete
$('.amp-editor-content').hide();
[74] Fix | Delete
$("#ampforwp-amp-content-error-msg").html("AMP contents is blank, Please enter content");
[75] Fix | Delete
}
[76] Fix | Delete
}else{
[77] Fix | Delete
$("#ampforwp-amp-content-error-msg").html("AMP contents is blank, Please enter content");
[78] Fix | Delete
}
[79] Fix | Delete
});
[80] Fix | Delete
}
[81] Fix | Delete
});
[82] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function