PluginProbe
Ultimate Post Kit – Elementor Post Grid, Post Carousel, Post Slider & Blog Layout Widgets / 4.5.6
Ultimate Post Kit – Elementor Post Grid, Post Carousel, Post Slider & Blog Layout Widgets v4.5.6
4.5.6 4.5.5 4.5.4 4.2.1 4.2.2 4.2.3 4.5.0 4.5.2 4.5.3 4.2.0 4.1.18 4.1.17 4.1.16 4.1.15 4.1.14 4.1.13 4.1.12 4.1.11 4.1.10 4.1.9 4.1.8 4.0.9 4.1.0 4.1.1 4.1.2 All 148 releases
← All changes | includes/setup-wizard/assets/js/setup-wizard.js +46 -13 4.1.15 → 4.5.6 View file →
@@ -124,8 +124,9 @@
124 124
125 125 this.saveSettingsSubmit();
126 126 this.installPlugins();
127 127 this.onChangedPluginSliderCheckbox();
128 + this.subscribeSubmit();
128 129
129 130 const featureItems = document.querySelectorAll('.bdt-feature-item');
130 131 featureItems.forEach(item => {
131 132 item.addEventListener('mouseenter', () => {
@@ -328,8 +329,40 @@
328 329 }, 600);
329 330 });
330 331 },
331 332
333 + /**
334 + * The newsletter opt-in sits in the welcome step and has no submit
335 + * button of its own: the choice is sent when the user moves on with
336 + * "Get Started".
337 + *
338 + * Fire and forget — the step change is never delayed and shows no
339 + * status. The box is unticked by default and gates the subscription
340 + * server side; an unticked box sends nothing to the newsletter list.
341 + */
342 + subscribeSubmit: function () {
343 + $(document).on('click', '.bdt-wizard-step[data-step="welcome"] .bdt-wizard-next', function () {
344 + const $email = $('#bdt-subscribe-email');
345 +
346 + if (!$email.length) {
347 + return;
348 + }
349 +
350 + $.ajax({
351 + url: UPK_SetupWizard.ajax_url,
352 + type: 'POST',
353 + data: {
354 + action: 'ultimate_post_kit_setup_wizard_subscribe',
355 + nonce: UPK_SetupWizard.nonce,
356 + email: ($email.val() || '').trim(),
357 + consent: $('#bdt-subscribe-consent').is(':checked') ? 'yes' : 'no'
358 + }
359 + });
360 +
361 + // No preventDefault: the step change proceeds immediately.
362 + });
363 + },
364 +
332 365 saveSettingsSubmit: function () {
333 366 const vm = this;
334 367 $('#upk_setup_wizard_modules').submit(function (e) {
335 368 e.preventDefault();
@@ -343,9 +376,9 @@
343 376 saveBtn.prop('disabled', true)
344 377 .html('<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span> Saving...');
345 378
346 379 $.ajax({
347 - url: BDT_SetupWizard.ajax_url,
380 + url: UPK_SetupWizard.ajax_url,
348 381 type: 'POST',
349 382 data: data,
350 383 success: function (response) {
351 384 if (response.success) {
@@ -427,13 +460,13 @@
427 460
428 461 statusText.textContent = `Installing ${pluginName}...`;
429 462
430 463 jQuery.ajax({
431 - url: BDT_SetupWizard.ajax_url,
464 + url: UPK_SetupWizard.ajax_url,
432 465 method: 'POST',
433 466 data: {
434 - action: 'setup_wizard_install_plugins',
435 - nonce: BDT_SetupWizard.nonce,
467 + action: 'ultimate_post_kit_setup_wizard_install_plugins',
468 + nonce: UPK_SetupWizard.nonce,
436 469 plugins: [slug]
437 470 },
438 471 success: (response) => {
439 472 if (response.success) {
@@ -522,13 +555,13 @@
522 555
523 556 if (isJsonTemplate) {
524 557 // Handle JSON template import
525 558 $.ajax({
526 - url: BDT_SetupWizard.ajax_url,
559 + url: UPK_SetupWizard.ajax_url,
527 560 type: 'POST',
528 561 data: {
529 - action: 'import_elementor_template',
530 - nonce: BDT_SetupWizard.nonce,
562 + action: 'ultimate_post_kit_import_elementor_template',
563 + nonce: UPK_SetupWizard.nonce,
531 564 import_url: importUrl
532 565 },
533 566 success: function(response) {
534 567 if (response.success) {
@@ -569,13 +602,13 @@
569 602 });
570 603 } else if (isZipTemplate) {
571 604 // Handle ZIP template import
572 605 $.ajax({
573 - url: BDT_SetupWizard.ajax_url,
606 + url: UPK_SetupWizard.ajax_url,
574 607 type: 'POST',
575 608 data: {
576 - action: 'import_upk_elementor_bundle_template',
577 - nonce: BDT_SetupWizard.nonce,
609 + action: 'ultimate_post_kit_import_elementor_bundle_template',
610 + nonce: UPK_SetupWizard.nonce,
578 611 import_url: importUrl
579 612 },
580 613 success: async function(response) {
581 614 if (response.success) {
@@ -663,11 +696,11 @@
663 696 async function importRunner(sessionId, runner) {
664 697 try {
665 698 const response = await new Promise((resolve, reject) => {
666 699 $.ajax({
667 - url: BDT_SetupWizard.ajax_url, type: 'POST', data: {
668 - action: 'import_upk_elementor_bundle_runner_template',
669 - nonce: BDT_SetupWizard.nonce,
700 + url: UPK_SetupWizard.ajax_url, type: 'POST', data: {
701 + action: 'ultimate_post_kit_import_elementor_bundle_runner_template',
702 + nonce: UPK_SetupWizard.nonce,
670 703 sessionId: sessionId,
671 704 runner: runner,
672 705 }, success: resolve, error: reject
673 706 })