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:
committed by
pavel-mailpoet
parent
7ae25ae299
commit
fcef5f0d2b
@ -54,6 +54,18 @@ function Intro() {
|
|||||||
document.body.classList.remove('mailpoet-intro-active');
|
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();
|
intro.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,6 +47,7 @@ class Changelog {
|
|||||||
} else {
|
} else {
|
||||||
$skip_wizard = WPHooks::applyFilters('mailpoet_skip_welcome_wizard', false);
|
$skip_wizard = WPHooks::applyFilters('mailpoet_skip_welcome_wizard', false);
|
||||||
$redirect_url = $skip_wizard ? null : admin_url('admin.php?page=mailpoet-welcome-wizard');
|
$redirect_url = $skip_wizard ? null : admin_url('admin.php?page=mailpoet-welcome-wizard');
|
||||||
|
Setting::setValue('show_intro', true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -305,6 +305,7 @@
|
|||||||
<% endblock %>
|
<% endblock %>
|
||||||
|
|
||||||
<% block after_javascript %>
|
<% block after_javascript %>
|
||||||
|
<% if settings.show_intro %>
|
||||||
<script>
|
<script>
|
||||||
if (typeof olark !== 'undefined') {
|
if (typeof olark !== 'undefined') {
|
||||||
olark('api.box.onShow', function() {
|
olark('api.box.onShow', function() {
|
||||||
@ -318,4 +319,5 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
<% endif %>
|
||||||
<% endblock %>
|
<% endblock %>
|
||||||
|
Reference in New Issue
Block a user