Skip to content

Commit

Permalink
Merge branch 'fix/wpml-translate-slugs' into fix/wpml-my-courses
Browse files Browse the repository at this point in the history
  • Loading branch information
merkushin committed Apr 8, 2024
2 parents d856fbc + 7e9fe51 commit d2b8ce6
Show file tree
Hide file tree
Showing 18 changed files with 770 additions and 760 deletions.
12 changes: 12 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
*** Changelog ***

## 4.23.0 - 2024-04-04
### Added
- Sensei pro upsell task in Sensei Home [#7562](https://github.com/Automattic/sensei/pull/7562)

### Deprecated
- Remove Sell your course with WooCommerce task from core [#7572](https://github.com/Automattic/sensei/pull/7572)

### Fixed
- Ensure student can view the lesson content when rendering the Complete Lesson button [#7579](https://github.com/Automattic/sensei/pull/7579)
- Remove opinionated CSS class from login form [#7542](https://github.com/Automattic/sensei/pull/7542)
- Visibility improved for focus elements of Course tour [#7570](https://github.com/Automattic/sensei/pull/7570)

## 4.22.0 - 2024-03-20
### Added
- Added Course onboarding tour [#7535](https://github.com/Automattic/sensei/pull/7535)
Expand Down
4 changes: 0 additions & 4 deletions changelog/add-deprecate-sell-course-wth-woocommerce-task

This file was deleted.

4 changes: 0 additions & 4 deletions changelog/add-make-sure-focused-elements-are-visible

This file was deleted.

4 changes: 0 additions & 4 deletions changelog/add-sensei-pro-upsell-task

This file was deleted.

4 changes: 0 additions & 4 deletions changelog/remove-opinionated-block-editor-class

This file was deleted.

2 changes: 1 addition & 1 deletion includes/admin/class-sensei-tour.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public function get_tour_completion_status( $tour_id, $user_id = 0 ) {
/**
* Get the callback to enqueue the course or lesson tour.
*
* @since $$next-version$$
* @since 4.23.0
*
* @param string $post_type The post type.
* @param string $handle The script handle.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* File containing the Sensei_Home_Task_Pro_Upsell class.
*
* @package sensei-lms
* @since $$next-version$$
* @since 4.23.0
*/

if ( ! defined( 'ABSPATH' ) ) {
Expand All @@ -13,7 +13,7 @@
/**
* Sensei_Home_Task_Pro_Upsell.
*
* @since $$next-version$$
* @since 4.23.0
*/
class Sensei_Home_Task_Pro_Upsell implements Sensei_Home_Task {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/**
* Sensei_Home_Task_Sell_Course_With_WooCommerce class.
*
* @deprecated $$next-version$$ We're now showing the "Sell your course with Sensei Pro" (Sensei_Home_Task_Pro_Upsell) task instead of this task.
* @deprecated 4.23.0 We're now showing the "Sell your course with Sensei Pro" (Sensei_Home_Task_Pro_Upsell) task instead of this task.
*
* @since 4.8.0
*/
Expand All @@ -21,9 +21,9 @@ class Sensei_Home_Task_Sell_Course_With_WooCommerce implements Sensei_Home_Task
*/
public function __construct() {
if ( is_wp_version_compatible( '6.4' ) ) {
_deprecated_class( __CLASS__, '$$next-version$$', 'Sensei_Home_Task_Pro_Upsell' );
_deprecated_class( __CLASS__, '4.23.0', 'Sensei_Home_Task_Pro_Upsell' );
} else {
_deprecated_function( __METHOD__, '$$next-version$$', 'Sensei_Home_Task_Pro_Upsell::__construct' );
_deprecated_function( __METHOD__, '4.23.0', 'Sensei_Home_Task_Pro_Upsell::__construct' );
}
}

Expand Down
9 changes: 6 additions & 3 deletions includes/blocks/class-sensei-complete-lesson-block.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ public function __construct() {
*
* @return string The block HTML.
*/
public function render( array $attributes, string $content ) : string {
public function render( array $attributes, string $content ): string {
if ( ! sensei_can_user_view_lesson() ) {
return '';
}

$lesson = get_post();

if ( empty( $lesson ) ) {
Expand All @@ -51,7 +55,6 @@ public function render( array $attributes, string $content ) : string {
}

if ( false === Sensei()->lesson->lesson_has_quiz_with_questions_and_pass_required( $lesson->ID ) ) {

return $this->render_with_form( $attributes, $content );
}

Expand All @@ -66,7 +69,7 @@ public function render( array $attributes, string $content ) : string {
*
* @return string The HTML to render.
*/
private function render_with_form( array $attributes, string $content ) : string {
private function render_with_form( array $attributes, string $content ): string {
wp_enqueue_script( 'sensei-stop-double-submission' );
$nonce = wp_nonce_field( 'woothemes_sensei_complete_lesson_noonce', 'woothemes_sensei_complete_lesson_noonce', false, false );
$permalink = esc_url( get_permalink() );
Expand Down
4 changes: 4 additions & 0 deletions includes/blocks/course-theme/class-lesson-actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ public function __construct() {
* @return string The complete lesson button.
*/
private function render_complete_lesson( string $button_class, bool $is_outline_style, bool $is_disabled ): string {
if ( ! sensei_can_user_view_lesson() ) {
return '';
}

$button_style_class = $is_outline_style ? 'is-style-outline' : '';
$disabled_attribute = $is_disabled ? 'disabled' : '';

Expand Down

0 comments on commit d2b8ce6

Please sign in to comment.