: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
var WPMLCore = WPMLCore || {};
WPMLCore.wizardFramework = function ( $, wizardImplementation ) {
self.backButton = $( '.js-wizard-back' );
self.nextButton = $( '.js-wizard-next' );
self.stepContent = $( '.js-wizard-step-content' );
self.nonce = $( '.js-wpml-wizard' ).data( 'nonce' );
self.steps = $( '.js-wizard-step' );
self.currentStep = self.getCurrentStep();
self.getCurrentStepIndex();
self.initializeButtons();
wizardImplementation.notifyCurrentStep( self.currentStep );
self.hideScreenOptions();
var showElement = function ( element, state ) {
self.moveToStep = function ( newStep ) {
var beforeCurrentStepClass = 'wizard-active-step';
self.steps.removeClass( beforeCurrentStepClass );
self.steps.each( function ( index ) {
if ( index === self.currentStepIndex ) {
$( this ).removeClass( 'wizard-current-step' );
if ( index === newStep ) {
self.currentStep = $( this ).addClass( 'wizard-current-step' ).data( 'step-slug' );
beforeCurrentStepClass = '';
if ( beforeCurrentStepClass ) {
$( this ).addClass( beforeCurrentStepClass );
self.currentStepIndex = newStep;
self.setBackButtonState();
self.setNextButtonState();
self.showSteps = function ( state ) {
showElement( $( '.js-wizard-steps-container' ), state );
self.moveToNextStep = function ( e ) {
wizardImplementation.isOkToMoveToNextStep( self.currentStep, function () {
self.moveToStep( self.currentStepIndex + 1 );
self.moveToPreviousStep = function ( e ) {
self.moveToStep( self.currentStepIndex - 1 );
self.getCurrentStepIndex = function () {
self.steps.each( function ( index ) {
if ( self.currentStep === $( this ).data( 'step-slug' ) ) {
self.currentStepIndex = index;
self.getCurrentStep = function () {
return self.stepContent.data( 'current-step' );
self.initializeButtons = function () {
self.backButton.on( 'click', self.moveToPreviousStep );
self.nextButton.on( 'click', self.moveToNextStep );
self.setBackButtonState();
self.setNextButtonState();
self.setBackButtonState = function () {
if ( self.currentStepIndex === 0 ) {
self.backButton.attr( 'disabled', 'disabled' );
self.backButton.removeAttr( 'disabled' );
self.setNextButtonState = function () {
self.enableNextButton( self.currentStepIndex !== self.steps.length - 1 );
self.fetchContent = function ( data ) {
action: 'wpml_wizard_fetch_content',
step_slug: self.currentStep,
success: function ( response ) {
$( '.js-wpml-wizard' ).show();
if ( response.success ) {
self.stepContent.html( response.data );
wizardImplementation.notifyContentFetched( self.currentStep, self.stepContent );
self.showBackButton = function ( state ) {
showElement( self.backButton, state );
self.showNextButton = function ( state ) {
showElement( self.nextButton, state );
self.setNextButtonText = function ( text ) {
self.nextButton.html( text );
self.enableNextButton = function ( state ) {
self.nextButton.removeAttr( 'disabled' );
self.nextButton.attr( 'disabled', 'disabled' );
self.setNextButtonPrimary = function ( state ) {
self.nextButton.addClass( 'button-primary' ).removeClass( 'button-secondary' );
self.nextButton.addClass( 'button-secondary' ).removeClass( 'button-primary' );
self.triggerNextStep = function () {
self.nextButton.trigger( 'click' );
self.storeData = function ( key, data ) {
self.storage[ key ] = data;
self.getData = function ( key, defaultValue ) {
if ( self.storage[ key ] ) {
return self.storage[ key ];
self.hideNotices = function () {
$( '.otgs-notice, .icl_admin_message' ).hide();
self.hideScreenOptions = function () {
$( '#screen-meta-links' ).hide();
WPMLCore.wizardFrameworkFactory = {
create: function ( $, wizardImplementation ) {
return new WPMLCore.wizardFramework( $, wizardImplementation );