The Media attachments extension is not supporting Learning mode or block-based themes for now. The recommended alternative is to use the File block, which should provide the same functionality.
In case you have a lot of existing lessons set up with media attachments, here is a snippet to add the section back for learning mode lessons:
add_filter( 'sensei_media_attachments_prepend_to_the_content', 'sensei_media_attachments_display_attached_media' );
function sensei_media_attachments_display_attached_media( $show ) {
$is_learning_mode = class_exists('Sensei_Course_Theme_Option') && Sensei_Course_Theme_Option::should_use_learning_mode();
return $show || $is_learning_mode;
}
Or an alternative for all lessons if using a block theme:
remove_action( 'sensei_single_lesson_content_inside_after', array( Sensei_Media_Attachments::instance(), 'display_attached_media' ), 35 );
add_filter( 'sensei_media_attachments_prepend_to_the_content', 'sensei_media_attachments_display_attached_media' );
function sensei_media_attachments_display_attached_media( $display ) {
return $display || is_singular( 'lesson' ) ;
}
Note that these will show the attachments before the lesson content.