: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
function bws_show_settings_notice() {
$( '.updated.fade:not(.bws_visible), .error:not(.bws_visible)' ).css( 'display', 'none' );
$( '#bws_save_settings_notice' ).css( 'display', 'block' );
* add notice about changing on the settings page
$( '.bws_form input, .bws_form textarea, .bws_form select' ).on(
if ( $( this ).attr( 'type' ) != 'submit' && ! $( this ).hasClass( 'bws_no_bind_notice' ) && typeof ( e.originalEvent ) != 'undefined' ) {
bws_show_settings_notice();
$( '.bws_save_anchor' ).on(
$( '.bws_form #bws-submit-button' ).click();
if ( 'function' == typeof wp.CodeMirror || 'function' == typeof CodeMirror ) {
var CodeMirrorFunc = ( typeof wp.CodeMirror != 'undefined' ) ? wp.CodeMirror : CodeMirror;
if ( $( '#bws_newcontent_css' ).length > 0 ) {
var editor = CodeMirrorFunc.fromTextArea(
document.getElementById( 'bws_newcontent_css' ),
addModeClass: 'bws_newcontent_css',
if ( $( '#bws_newcontent_php' ).length > 0 ) {
var editor = CodeMirrorFunc.fromTextArea(
document.getElementById( "bws_newcontent_php" ),
editor.markText( {ch:0,line:0}, {ch:0,line:5}, { readOnly: true, className: 'bws-readonly' } );
if ( $( '#bws_newcontent_js' ).length > 0 ) {
var editor = CodeMirrorFunc.fromTextArea(
document.getElementById( "bws_newcontent_js" ),
$( '.bws_banner_to_settings_joint .bws-details' ).addClass( 'hidden' ).removeClass( 'hide-if-js' );
$( '.bws_banner_to_settings_joint .bws-more-links' ).on(
if ( $( '.bws_banner_to_settings_joint .bws-less' ).hasClass( 'hidden' ) ) {
$( '.bws_banner_to_settings_joint .bws-less, .bws_banner_to_settings_joint .bws-details' ).removeClass( 'hidden' );
$( '.bws_banner_to_settings_joint .bws-more' ).addClass( 'hidden' );
$( '.bws_banner_to_settings_joint .bws-less, .bws_banner_to_settings_joint .bws-details' ).addClass( 'hidden' );
$( '.bws_banner_to_settings_joint .bws-more' ).removeClass( 'hidden' );
if ( $( '.bws_help_box' ).length > 0 ) {
if ( $( 'body' ).hasClass( 'rtl' ) ) {
var current_position = { my: "right top+15", at: "right bottom" };
var current_position = { my: "left top+15", at: "left bottom" };
items: $( '.bws_help_box' ),
return $( this ).find( '.bws_hidden_help_text' ).html()
show: null, /* show immediately */
tooltipClass: "bws-tooltip-content",
position: current_position,
open: function( event, ui ) {
if ( typeof( event.originalEvent ) === 'undefined' ) {
if ( $( event.originalEvent.target ).hasClass( 'bws-auto-width' ) ) {
ui.tooltip.css( "max-width", "inherit" );
var $id = $( ui.tooltip ).attr( 'id' );
/* close any lingering tooltips */
$( 'div.ui-tooltip' ).not( '#' + $id ).remove();
close: function( event, ui ) {
$( this ).stop( true ).fadeTo( 200, 1 );
* Handle the styling of the "Settings" tab on the plugin settings page
var tabs = $( '#bws_settings_tabs_wrapper' );
var current_tab_field = $( 'input[name="bws_active_tab"]' ),
prevent_tabs_change = false,
active_tab = current_tab_field.val();
if ( '' == active_tab ) {
var active_tab_index = 0;
var active_tab_index = $( '#bws_settings_tabs li[data-slug=' + active_tab + ']' ).index();
$( '.bws_tab' ).css( 'min-height', $( '#bws_settings_tabs' ).css( 'height' ) );
/* jQuery tabs initialization */
if ( ! prevent_tabs_change ) {
active_tab = ui.newTab.data( 'slug' );
current_tab_field.val( active_tab );
prevent_tabs_change = false;
$( '.bws_trigger_tab_click' ).on(
$( '#bws_settings_tabs a[href="' + $( this ).attr( 'href' ) + '"]' ).click();
* Hide content for options on the plugin settings page
var options = $( '.bws_option_affect' );
if ( element.is( ':selected' ) || element.is( ':checked' ) ) {
$( element.data( 'affect-show' ) ).show();
$( element.data( 'affect-hide' ) ).hide();
$( element.data( 'affect-show' ) ).hide();
$( element.data( 'affect-hide' ) ).show();
if ( element.is( 'option' ) ) {
var affect_hide = element.data( 'affect-hide' ),
affect_show = element.data( 'affect-show' );
if ( element.is( ':selected' ) ) {
var affect_hide = element.data( 'affect-hide' ),
affect_show = element.data( 'affect-show' );
if ( element.is( ':selected' ) || element.is( ':checked' ) ) {