: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
var reduxOptionSearch = function(){
if(jQuery('.redux_field_search').length > 0){
jQuery('.redux_field_search').typeWatch({
callback:function( searchString ){
searchString = searchString.toLowerCase();
var searchArray = searchString.split(' ');
var parent = $(this).parents('.redux-container:first');
var expanded_options = parent.find('.expand_options');
if (searchString != "") {
if (!expanded_options.hasClass('expanded')) {
expanded_options.click();
parent.find('.redux-main').addClass('redux-search');
if (expanded_options.hasClass('expanded')) {
expanded_options.click();
parent.find('.redux-main').removeClass('redux-search');
//parent.find('.redux-section-field, .redux-info-field, .redux-notice-field, .redux-container-group, .redux-section-desc, .redux-group-tab h3').show();
if($('.redux-group-tab-link-li.active').length>0){
var rel = $('.redux-group-tab-link-li.active a').attr('data-rel');
var selector = 'div#'+rel+'_section_group';
jQuery(selector).css('display','block');
$('.redux-group-tab-link-li.activeChild').click();
$('div#'+rel+'_section_group').show();
$('#'+rel+'_section_group').css('display','block');
parent.find('.redux-field-container').each(function() {
if (searchString != "") {
parent.find('div.redux-group-tab').css('display','none');
$(this).parents('tr:first').hide();
$(this).parents('tr:first').show();
parent.find('.form-table tr').filter(function () {
$('.redux-tab-container').show();
$('.redux-tab-container').each(function(){
$(this).find('.redux-tab-selector:first').click();
if(item.hasClass('hide')){
text = $(this).find('.redux_field_th').text().toLowerCase();
if ( !text || text == "" ) {
$.each(searchArray, function (i, searchStr) {
if (text.indexOf(searchStr) == -1) {
$(this).parents('div.redux-group-tab').css('display','block');
}).show( function() { });
parent.find('.redux-group-tab').each(function() {
if (searchString != "") {
$(this).find("div.redux-section-field").each(function(){
var divSectionId = $(this).attr('id');
var splitResult = divSectionId.split("-");
splitResult.splice(1, 0, "table");
var divTableId = splitResult.join("-");
var totalTr = $("#"+divTableId).find('tr:visible').length;
$(this).find("div.redux-section-field").each(function(){
if(item.hasClass('hide')){
var divSectionId = $(this).attr('id');
var splitResult = divSectionId.split("-");
splitResult.splice(1, 0, "table");
var divTableId = splitResult.join("-");
var totalTr = $("#"+divTableId).find('tr:visible').length;
$(this).find('.form-table-section tbody').each(function(){
$(this).find('tr').each(function (i, el) {
if(item.hasClass('hide')){
if(item.hasClass('redux-section-indent-start')){
}); // parent.find('.redux-group-tab') Closed
$('.redux-container').each(function() {
if (!$(this).hasClass('redux-no-sections')) {
$(this).find('.display_header').append('<span class="search-wrapper"><input class="redux_field_search" name="" type="text" placeholder="Search the controls" style="display:none"/><span class="redux-amp-search-icon"><i class="dashicons-before dashicons-search"></i></span></span>');
$('.redux-amp-search-icon').on("click", function(){
$('.redux_field_search').toggle('slide');
var val = $('.redux_field_search').val();
var display = $('.redux_field_search').css('display');
if(val!='' && display=='block'){
$('.redux_field_search').val('');
var parent = jQuery('.redux_field_search').parents('.redux-container:first');
var expanded_options = parent.find('.expand_options');
if (expanded_options.hasClass('expanded')) {
expanded_options.click();
parent.find('.redux-main').removeClass('redux-search');
//parent.find('.redux-section-field, .redux-info-field, .redux-notice-field, .redux-container-group, .redux-section-desc, .redux-group-tab h3').show();
if($('.redux-group-tab-link-li.active').length>0){
var rel = $('.redux-group-tab-link-li.active a').attr('data-rel');
var selector = 'div#'+rel+'_section_group';
jQuery(selector).css('display','block');
$('.redux-group-tab-link-li.activeChild').click();
$('div#'+rel+'_section_group').show();
$('#'+rel+'_section_group').css('display','block');
parent.find('.redux-field-container').each(function() {
$(this).parents('tr:first').show();
parent.find('.redux-group-tab').each(function() {
$(this).find("div.redux-section-field").each(function(){
if(item.hasClass('hide')){
var divSectionId = $(this).attr('id');
var splitResult = divSectionId.split("-");
splitResult.splice(1, 0, "table");
var divTableId = splitResult.join("-");
var totalTr = $("#"+divTableId).find('tr:visible').length;
$(this).find('.form-table-section tbody').each(function(){
$(this).find('tr').each(function (i, el) {
if(item.hasClass('hide')){
if(item.hasClass('redux-section-indent-start')){
function ampforwp_get_cookie(cname) {
var ca = document.cookie.split(';');
for(var i = 0; i < ca.length; i++) {
while (c.charAt(0) == ' ') {
if (c.indexOf(name) == 0) {
return c.substring(name.length, c.length);
var ref_lap = ampforwp_get_cookie('ref_lap');
var ref_nonce = ampforwp_get_cookie('ref_nonce');
var current_post = ampforwp_get_cookie('current_post');
if(current_post!='' && ref_nonce!=''){
ampforwp_refresh_related_post(ref_nonce, current_post);
function ampforwp_refresh_related_post(ref_nonce='', current_post=''){
var elem = document.getElementById("ref_rel_post_bar");
var first_int = setInterval(first_frame, 1000);
var width = current_post;
elem.style.width = width + '%';
elem.innerHTML = width * 1 + '%';
elem.style.width = width + '%';
elem.innerHTML = width * 1 + '%';
action: 'ampforwp_referesh_related_post',
current_post: current_post,
success: function(response){
clearInterval(first_int);
response = response.replace("}0", "}");
var resp = JSON.parse(response);
resp = parseInt(resp.response);
var id = setInterval(frame, 10);
var width = current_post;
elem.style.width = width + '%';
elem.innerHTML = width * 1 + '%';
$('#ampforwp-refersh-related-post').remove();
$('#redux_builder_amp-ampforwp-refersh-related-post .description').html('All the posts have been refreshed successfully.');
var ref_nonce = ampforwp_get_cookie('ref_nonce');
var current_post = ampforwp_get_cookie('current_post');
if(current_post!='' && ref_nonce!='' && current_post<100){
ampforwp_refresh_related_post(ref_nonce, current_post);
$("#ampforwp-refersh-related-post").on('click', function(){
var ref_nonce = $(this).attr('data-nonce');
var current_post = parseInt($(this).attr('data-id'));
ampforwp_refresh_related_post(ref_nonce, current_post);
$(".redux_field_search").on( "keypress", function (evt) {
//Deterime where our character code is coming from within the event
var charCode = evt.charCode || evt.keyCode;
if (charCode == 13) { //Enter key's keycode
//option panel Section Division
var optionSectionDevision = function(){
$('.afw-accordion-header').on("click", function(){
if ( $.cookie( "redux_current_section_customize" )){
var allReduxTabs = JSON.parse($.cookie( "redux_current_section_customize" ));
var section = $(this).attr("id");
section = section.replace("section-","section-table-");
if($("#"+section).is(':visible')){
$(this).removeClass("afw-accordion-tab-open").addClass("afw-accordion-tab-close");
allReduxTabs[section] = 'hide';
$(this).removeClass("afw-accordion-tab-close").addClass("afw-accordion-tab-open");
allReduxTabs[section] = 'show';
'redux_current_section_customize', JSON.stringify(allReduxTabs), {
//While loading at first time
if($('.afw-accordion-header').length>0){
//console.log($.cookie( "redux_current_section_customize" ));
if ( $.cookie( "redux_current_section_customize" ) ){
var tabsValue = JSON.parse($.cookie( "redux_current_section_customize" ));
$('.afw-accordion-header').each(function(){
var reduxAccordianHeader = $(this);
var section = reduxAccordianHeader.attr("id");
section = section.replace("section-","section-table-");
var currentSettings = tabsValue[section];
if(currentSettings=='hide'){
reduxAccordianHeader.removeClass("afw-accordion-tab-open").addClass("afw-accordion-tab-close");
}else if(currentSettings=='show'){
reduxAccordianHeader.removeClass("afw-accordion-tab-close").addClass("afw-accordion-tab-open");
if(reduxAccordianHeader.hasClass('afw-accordion-tab-close')){
}else if(reduxAccordianHeader.hasClass('afw-accordion-tab-open')){
}//Cloesed function = optionSectionDevision
// Dismiss button functionlaity
$('#ampforwp-automattic-notice').on('click', 'button', function(){
var nonce = $('#ampforwp-automattic-notice').attr('data-nonce');
'action': 'ampforwp_automattic_notice_delete',
jQuery.post(ajaxurl, data_notice, function(response) {
var hideReduxLeftTabs = function(){
jQuery('ul.redux-group-menu > li.redux-group-tab-link-li').siblings('.redux-group-tab-link-li').each(function(key,Data){
if(key>3 && jQuery(this).hasClass("otherSectionFields")){
jQuery(this).attr("style","display:none;");
jQuery( '.redux-group-tab-link-a' ).on("click", function(){
if(jQuery(this).parent('li').hasClass('otherSectionFields')){
jQuery(this).parent('li.otherSectionFields').siblings('li.otherSectionFields').hide();
if(!jQuery(this).parent('li').is(':visible')){
jQuery(this).parent('li').show();
jQuery(this).parent('li').siblings('li.otherSectionFields').hide();
jQuery(this).parent('li').siblings('li.active').show();
var showExtensionTabs = function(){
var currentTab = getQueryStringValue('tabid');
if(currentTab!="" && $("li."+currentTab).length>0){
$("li."+currentTab+" a").click();
var switchTextfunc = function(){
var switchText = $('.switch-text');
switchText.each(function(e,v){
if ( $(this).siblings('input').attr('value') == 1 ) {
$(this).parent('div.switch-options').find('.switch-text-on').show();
else if ( $(this).siblings('input').attr('value') == 0 ) {
$(this).parent('div.switch-options').find('.switch-text-off').show();
switchText.siblings('label').on("click", function(){
if ( $(this).siblings('input').attr('value') == 1 ) {
$(this).parent().find('.switch-text-on').hide();
$(this).parent().find('.switch-text-off').show();
else if ( $(this).siblings('input').attr('value') == 0 ) {
$(this).parent().find('.switch-text-off').hide();
$(this).parent().find('.switch-text-on').show();
$(document).ready(function() {
if(getQueryStringValue('page')=='amp_options'){
//Tab section implementation
//To Show title on the top; In front of search bar
if($( '.redux-group-tab-link-a' ).length){
//To Hide Leftsidebar option Below Extension
var gURL, gAPIkey, disableGFonts;
gAPIkey = redux_data.google_font_api_key;
disableGFonts = redux_data.amp_google_font_restrict;
if(gAPIkey=='' || typeof gAPIkey == 'undefined'){
$('.ampforwp-google-font-restrict').css({'display':'none'});
// Append data into selects
ampforwp_font_generator();
function ampforwp_font_generator() {
gAPIkey = redux_data.google_font_api_key;
fontswitch = redux_data['ampforwp-google-font-switch'];
disableGFonts = redux_data.amp_google_font_restrict;
if($("#google_font_api_key").length>0){
$("#google_font_api_key").after("<input type='submit' value='Verify'>");
if(gAPIkey=='' || typeof gAPIkey == 'undefined'){
$('.ampforwp-google-font-restrict').css({'display':'none'});
gAPIkey = $('#google_font_api_key').val();
if(gAPIkey=='' || typeof gAPIkey == 'undefined'){
$('#redux_builder_amp-google_font_api_key').append('<p style="color:red"> Could not connect to API, please double check your API key. </p> ');
$('.ampforwp-google-font-class').css({'display':'none'});
gURL = "https://www.googleapis.com/webfonts/v1/webfonts?key=" + gAPIkey;
if (localStorage.getItem("googlefontapidata") === null) {
var gfontData = $.get( gURL );
gfontData.done(function( data ) {
localStorage.setItem('googlefontapidata', JSON.stringify(data));
ampforwp_fonts_select_data(data);
gfontData.fail(function(data) {
$('#redux_builder_amp-google_font_api_key').append('<p style="color:red"> Could not connect to API, please double check your API key. </p> ');
$('.ampforwp-google-font-class').css({'display':'none'});
gfontData.always(function(){
amp_font_selector_select_change();
data = localStorage.getItem("googlefontapidata");
ampforwp_fonts_select_data(JSON.parse(data));
amp_font_selector_select_change();
ampforwp_heading_fonts_select();
function ampforwp_heading_fonts_select(){
gAPIkey = redux_data.google_font_api_key;
fontswitch = redux_data['ampforwp-google-font-switch'];
if(fontswitch != 1 || gAPIkey=='' || typeof gAPIkey == 'undefined'){
var all_fonts = localStorage.getItem("googlefontapidata");
all_fonts = JSON.parse(all_fonts);
all_fonts_values = Object.values(all_fonts.items);
let target_heading_select= jQuery('#amp_font_selector_heading-select');
for (const sfont of all_fonts_values) {
if(redux_data.amp_font_selector_heading==sfont.family){
selected_heading ='selected';
target_heading_select.append(jQuery('<option value="'+sfont.family+'" '+selected_heading+'> '+sfont.family+' </option>'));
target_heading_select.trigger('change');
function ampforwp_fonts_select_data(data){
if(data && localStorage.getItem("googlefontapidata") != null ){
var values = Object.values(data.items);
for (var i = 0; i < values.length; i++) {
allFonts.push({fontFamily: values[i].family });