Skip to content

Commit da146f4

Browse files
authored
Merge pull request #7711 from Automattic/release/4.24.4
Release 4.24.4
2 parents e6db554 + 3187a1a commit da146f4

24 files changed

+680
-645
lines changed

changelog.txt

+19
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,24 @@
11
*** Changelog ***
22

3+
## 4.24.4 - 2024-11-12
4+
### Security
5+
- Messages and emails accessible using the search REST API
6+
7+
### Added
8+
- Allow additional users to manage students [#7700](https://github.com/Automattic/sensei/pull/7700)
9+
10+
### Fixed
11+
- Horizontal scroll on Course page when using Course theme [#7705](https://github.com/Automattic/sensei/pull/7705)
12+
- Loading some translations too early which generates a warning on WP 6.7 [#7701](https://github.com/Automattic/sensei/pull/7701)
13+
- PHP deprecation notice in View Results block [#7680](https://github.com/Automattic/sensei/pull/7680)
14+
- Hello elementor theme throwing 404 when rendering the Courses archive page [#7683](https://github.com/Automattic/sensei/pull/7683)
15+
- Label on course complete email received by the teacher [#7672](https://github.com/Automattic/sensei/pull/7672)
16+
- Timed quiz not stopping when time ends [#7675](https://github.com/Automattic/sensei/pull/7675)
17+
18+
### Development
19+
- Added a hook to conditionally render the lesson actions in the frontend [#7677](https://github.com/Automattic/sensei/pull/7677)
20+
- Filter course IDs associated with a given teacher [#7702](https://github.com/Automattic/sensei/pull/7702)
21+
322
## 4.24.3 - 2024-08-22
423
### Fixed
524
- Ensure quiz description is displayed to the student [#7669](https://github.com/Automattic/sensei/pull/7669)

changelog/add-filter-student-management-teacher-ids

-4
This file was deleted.

changelog/fix-archive-404-issue-in-hello-elementor

-4
This file was deleted.

changelog/fix-co-teachers-get-students

-4
This file was deleted.

changelog/fix-course-horizontal-scroll-with-course-theme

-4
This file was deleted.

changelog/fix-early-translations

-4
This file was deleted.

changelog/fix-prevent-rendering-lesson-actions-in-content-drip

-4
This file was deleted.

changelog/fix-teacher-student-complete-email-label

-4
This file was deleted.

changelog/fix-timed-quiz-input-not-stopping-when-time-ends

-4
This file was deleted.

changelog/fix-view-results-block-deprecated-notice

-4
This file was deleted.

includes/admin/class-sensei-learner-management.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public function __construct( $file ) {
9898
/**
9999
* Graceful fallback for deprecated properties.
100100
*
101-
* @since $$next-version$$
101+
* @since 4.24.4
102102
*
103103
* @param string $key The key to get.
104104
*
@@ -722,7 +722,7 @@ private function can_user_manage_students( int $course_id, int $post_author ): b
722722
/**
723723
* Filter the user IDs that have permission to manage students in a given course.
724724
*
725-
* @since $$next-version$$
725+
* @since 4.24.4
726726
*
727727
* @hook sensei_learners_allowed_user_ids
728728
*

includes/class-sensei-analysis.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public function __get( $key ) {
7777
/**
7878
* Get the screen name.
7979
*
80-
* @since $$next-version$$
80+
* @since 4.24.4
8181
*
8282
* @return string
8383
*/

includes/class-sensei-grading.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function __construct( $file ) {
5252
/**
5353
* Graceful fallback for deprecated properties.
5454
*
55-
* @since $$next-version$$
55+
* @since 4.24.4
5656
*
5757
* @param string $key The key to get.
5858
*

includes/class-sensei-lesson.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -5077,7 +5077,7 @@ public static function should_show_lesson_actions( int $lesson_id, int $user_id
50775077
/**
50785078
* Filters if the lesson actions should be shown.
50795079
*
5080-
* @since $$next-version$$
5080+
* @since 4.24.4
50815081
*
50825082
* @hook sensei_lesson_show_actions
50835083
*

includes/class-sensei-posttypes.php

+27-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
<?php
2+
3+
use Sensei\Internal\Emails\Email_Post_Type;
4+
25
if ( ! defined( 'ABSPATH' ) ) {
36
exit; // Exit if accessed directly
47
}
@@ -111,6 +114,7 @@ public function __construct() {
111114

112115
// REST API functionality.
113116
add_action( 'rest_api_init', [ $this, 'setup_rest_api' ] );
117+
add_filter( 'rest_post_search_query', [ $this, 'exclude_post_types_from_rest_search' ] );
114118

115119
// Add protections on feeds for certain CPTs.
116120
add_action( 'wp', [ $this, 'protect_feeds' ] );
@@ -128,7 +132,7 @@ public function __construct() {
128132
/**
129133
* Graceful fallback for deprecated properties.
130134
*
131-
* @since $$next-version$$
135+
* @since 4.24.4
132136
*
133137
* @param string $key The key to get.
134138
*
@@ -177,6 +181,28 @@ public function setup_rest_api() {
177181
add_filter( 'post_password_required', [ $this, 'lesson_is_protected' ], 10, 2 );
178182
}
179183

184+
/**
185+
* Exclude post types from the REST API search.
186+
*
187+
* @since 4.24.4
188+
* @access private
189+
*
190+
* @param array $args The query args.
191+
* @return array The modified query args.
192+
*/
193+
public function exclude_post_types_from_rest_search( $args ) {
194+
$excluded_post_types = [
195+
'sensei_message',
196+
Email_Post_Type::POST_TYPE,
197+
];
198+
199+
if ( isset( $args['post_type'] ) ) {
200+
$args['post_type'] = array_diff( (array) $args['post_type'], $excluded_post_types );
201+
}
202+
203+
return $args;
204+
}
205+
180206
/**
181207
* Add protection to Sensei post type feeds.
182208
*

includes/class-sensei-quiz.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public function __construct( $file = __FILE__ ) {
113113
*
114114
* @internal
115115
*
116-
* @since $$next-version$$
116+
* @since 4.24.4
117117
* @return void
118118
*/
119119
public function enqueue_styles() {

includes/class-sensei-settings-api.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ public function __construct() {
140140
/**
141141
* Graceful fallback for deprecated properties.
142142
*
143-
* @since $$next-version$$
143+
* @since 4.24.4
144144
*
145145
* @param string $key The key to get.
146146
*

includes/class-sensei-teacher.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -841,7 +841,7 @@ public function filter_learners_query( $learners_sql ) {
841841
/**
842842
* Filter the course IDs associated with a given teacher.
843843
*
844-
* @since $$next-version$$
844+
* @since 4.24.4
845845
*
846846
* @hook sensei_teacher_course_ids
847847
*

0 commit comments

Comments
 (0)