Show intro only on new install (but not when migrating from WP2)

Intro is marked as shown only when "Skip" or "Done" is explicitly used - this
avoids closing the intro by mistake and never having the option to see it again.

[MAILPOET-1446]
This commit is contained in:
Jan Jakeš
2018-08-04 23:14:53 +02:00
committed by pavel-mailpoet
parent 7ae25ae299
commit fcef5f0d2b
3 changed files with 15 additions and 0 deletions

View File

@ -54,6 +54,18 @@ function Intro() {
document.body.classList.remove('mailpoet-intro-active');
});
intro.onskip(() => {
// this is called also when "Done" button used
MailPoet.Ajax.post({
api_version: window.mailpoet_api_version,
endpoint: 'settings',
action: 'set',
data: {
show_intro: 0,
},
});
});
intro.start();
}

View File

@ -47,6 +47,7 @@ class Changelog {
} else {
$skip_wizard = WPHooks::applyFilters('mailpoet_skip_welcome_wizard', false);
$redirect_url = $skip_wizard ? null : admin_url('admin.php?page=mailpoet-welcome-wizard');
Setting::setValue('show_intro', true);
}
}
}

View File

@ -305,6 +305,7 @@
<% endblock %>
<% block after_javascript %>
<% if settings.show_intro %>
<script>
if (typeof olark !== 'undefined') {
olark('api.box.onShow', function() {
@ -318,4 +319,5 @@
});
}
</script>
<% endif %>
<% endblock %>