: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
/*global redux_change, redux*/
* Feature added by : Smartik - http://smartik.ws/
redux.field_objects = redux.field_objects || {};
redux.field_objects.switch = redux.field_objects.switch || {};
redux.field_objects.switch.init = function( selector ) {
selector = $.redux.getSelector( selector, 'switch' );
if ( ! el.hasClass( 'redux-field-container' ) ) {
parent = el.parents( '.redux-field-container:first' );
if ( parent.is( ':hidden' ) ) {
if ( parent.hasClass( 'redux-field-init' ) ) {
parent.removeClass( 'redux-field-init' );
el.find( '.cb-enable' ).on(
if ( $( this ).hasClass( 'selected' ) ) {
parent = $( this ).parents( '.switch-options' );
$( '.cb-disable', parent ).removeClass( 'selected' );
$( this ).addClass( 'selected' );
$( '.checkbox-input', parent ).val( 1 ).trigger( 'change' );
redux_change( $( '.checkbox-input', parent ) );
// Fold/unfold related options.
$fold = '.f_' + obj.data( 'id' );
el.find( $fold ).slideDown( 'normal', 'swing' );
el.find( '.cb-disable' ).on(
if ( $( this ).hasClass( 'selected' ) ) {
parent = $( this ).parents( '.switch-options' );
$( '.cb-enable', parent ).removeClass( 'selected' );
$( this ).addClass( 'selected' );
$( '.checkbox-input', parent ).val( 0 ).trigger( 'change' );
redux_change( $( '.checkbox-input', parent ) );
// Fold/unfold related options.
$fold = '.f_' + obj.data( 'id' );
el.find( $fold ).slideUp( 'normal', 'swing' );
el.find( '.cb-enable span, .cb-disable span' ).find().attr( 'unselectable', 'on' );