Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove "Customize your lesson template" task #7539

Merged
merged 2 commits into from Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions changelog/update-remove-customize-lesson-template-task
@@ -0,0 +1,4 @@
Significance: minor
Type: removed

Remove "Customize your lesson template" from task list
Expand Up @@ -71,11 +71,8 @@ private function get_tasks(): array {
$core_tasks[] = new Sensei_Home_Task_Sell_Course_With_WooCommerce();
}

if ( Sensei_Home_Task_Customize_Course_Theme::is_active() ) {
$core_tasks[] = new Sensei_Home_Task_Customize_Course_Theme();
}

$tasks = [];

/**
* Each one of the core tasks.
*
Expand Down

This file was deleted.

13 changes: 0 additions & 13 deletions includes/class-sensei-admin.php
Expand Up @@ -1611,19 +1611,6 @@ public function admin_init() {
add_action( $hook, [ Sensei_Home_Task_Sell_Course_With_WooCommerce::class, 'mark_completed' ] );
}
}

// Mark the Course Theme Customization as completed if we are visiting
// the site editor or the customizer with the Course theme installed.
if ( Sensei_Home_Task_Customize_Course_Theme::is_active() ) {
if ( in_array( $pagenow, [ 'site-editor.php', 'customize.php' ], true ) ) {
// phpcs:ignore WordPress.Security.NonceVerification.Recommended
$post_id = isset( $_GET['postId'] ) ? sanitize_text_field( wp_unslash( $_GET['postId'] ) ) : '';

if ( Sensei_Course_Theme::get_learning_mode_template_id( 'lesson' ) === $post_id ) {
Sensei_Home_Task_Customize_Course_Theme::mark_completed();
}
}
}
}

function sensei_add_custom_menu_items() {
Expand Down

This file was deleted.

Expand Up @@ -67,19 +67,6 @@ public function testGet_WhenCalled_ReturnsReturnsExpectedTasks() {
$this->assertArrayHasKey( Sensei_Home_Task_Publish_First_Course::get_id(), $items );
}

public function testGet_WhenCalledWhileCourseThemeActive_IncludesCourseThemeCustomizationTask() {
// Arrange
switch_theme( 'course' );

// Act
$result = $this->provider->get();

// Assert
$items = $result['items'];
$this->assertIsArray( $items );
$this->assertArrayHasKey( Sensei_Home_Task_Customize_Course_Theme::get_id(), $items );
}

public function testGet_GivenAFilterThatOverridesTasks_ReturnSingleOverriddenResult() {
// Arrange
add_filter( 'sensei_home_tasks', [ $this, 'overrideWithFakeTask' ] );
Expand Down