Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added assets/images/whats-new/announcements.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/whats-new/assignments.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/whats-new/courses.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/whats-new/dashboard-dark.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/whats-new/dashboard-light.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/whats-new/dashboard.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/whats-new/discussions.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/whats-new/graph.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/whats-new/image-marking.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/whats-new/learners.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/whats-new/native-app-kids.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/whats-new/native-app.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/whats-new/navigation-bg.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/whats-new/navigation.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/whats-new/notes.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/whats-new/ordering-bg.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/whats-new/ordering.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/whats-new/pin.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/whats-new/puzzle.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/whats-new/quiz-attempts.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/whats-new/range.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/whats-new/smooth-navigation.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/whats-new/whats-new-hero.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
641 changes: 641 additions & 0 deletions assets/src/scss/admin-dashboard/_whats-new-v4.scss

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion assets/src/scss/admin-dashboard/index.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@import '../../../../v2-library/src/scss/reusables.scss';
@import './tutor-admin.scss';
@import './whats-new.scss';
@import './whats-new-v4.scss';
@import './v2/admin-v2-markup.scss';
@import './segments/withdraw.scss';
@import './segments/registration-notice.scss';
Expand All @@ -10,4 +11,4 @@
@import '../modules/certificate-list.scss';
@import '../modules/quiz-icons.scss';
@import './segments//legal-consents.scss';
@import './segments/consent-logs.scss';
@import './segments/consent-logs.scss';
85 changes: 85 additions & 0 deletions classes/WhatsNew.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ class WhatsNew {
*/
public function __construct() {
add_filter( 'tutor_admin_menu', array( $this, 'add_whats_new_menu_item' ) );
add_action( 'upgrader_process_complete', array( $this, 'set_whats_new_v4_redirect' ), 10, 2 );
add_action( 'admin_init', array( $this, 'maybe_redirect_to_whats_new_v4' ) );
add_action( 'admin_menu', array( $this, 'register_whats_new_in_v4_hidden_page' ), 99 );
}

/**
Expand Down Expand Up @@ -69,6 +72,88 @@ public function whats_new_page() {
include tutor()->path . 'views/pages/whats-new.php';
}

/**
* What's new in v4 page.
*
* @since 4.0.0
*
* @return void
*/
public function whats_new_in_v4_page() {
wp_enqueue_style( 'tutor-core-styles', tutor()->url . 'assets/css/tutor-core.min.css', array(), TUTOR_VERSION );
include tutor()->path . 'views/pages/whats-new-in-v4.php';
}

/**
* Register the What's New in v4 page as a hidden submenu (no sidebar link).
*
* @since 4.0.0
*
* @return void
*/
public function register_whats_new_in_v4_hidden_page() {
add_submenu_page(
'tutor', // parent slug.
__( "What's New in v4", 'tutor' ), // page title.
'', // empty menu title = hidden from sidebar.
'manage_options',
'tutor-whats-new-in-v4',
array( $this, 'whats_new_in_v4_page' )
);
}

/**

* Set a transient flag after plugin upgrade to trigger a one-time redirect.
*
* @since 4.0.0
*
* @param mixed $upgrader_object Upgrader instance.
* @param array $options Hook arguments.
*
* @return void
*/
public function set_whats_new_v4_redirect( $upgrader_object, $options ) {
if (
'update' === $options['action'] &&
'plugin' === $options['type'] &&
isset( $options['plugins'] ) &&
is_array( $options['plugins'] )
) {
foreach ( $options['plugins'] as $plugin ) {
if ( plugin_basename( TUTOR_FILE ) === $plugin ) {
set_transient( 'tutor_whats_new_v4_redirect', TUTOR_VERSION, 60 );
break;
}
}
}
}

/**
* Redirect to the What's New v4 page once after a plugin update.
*
* @since 4.0.0
*
* @return void
*/
public function maybe_redirect_to_whats_new_v4() {
// Only redirect for admins, not during AJAX, not during activation bulk actions.
if (
! is_admin() ||
wp_doing_ajax() ||
! current_user_can( 'manage_options' ) ||
! get_transient( 'tutor_whats_new_v4_redirect' )
) {
return;
}

// Delete the transient immediately so only the first admin gets redirected once.
delete_transient( 'tutor_whats_new_v4_redirect' );

wp_safe_redirect( admin_url( 'admin.php?page=tutor-whats-new-in-v4' ) );
exit;
}

/**
* Get tutor plugin version info
*
Expand Down
Loading
Loading