Version 1.8.0 of Sensei has just been released. See our documentation for details of how to update.
This update introduces several new features, so as usual, we strongly recommend testing the update on a staging site before updating your live site.
Here’s an overview of what’s new in Sensei 1.8:
- Teachers can now create and manage their own courses (including lessons and quizzes). See Sensei Roles & Capabilities
- This works with WooCommerce Product Vendors, allowing teachers to earn commission on sales of their courses.
- Modules are now in Sensei core (so you can remove the modules extension if you have it).
- Many lesson and quiz settings can now be updated via Bulk Edit and Quick Edit.
- Email notifications can now be disabled on a per-course basis. See Email Notifications
- The Sensei menu items in the WordPress admin have been restructured to be more logical. See Sensei Menu Items.
Note: The Sensei Course Progress extension has also been updated (v1.0.4) to work with Sensei 1.8. Again, make sure you remove the Modules extension before updating Sensei Course Progress, as it won’t work with the Modules extension.
Important notes for developers:
Sensei global instance function
In previous versions you had to to declare the global $Woothemes_Sensei before you could gain access to Sensei properties, but from now on you can simply use:
The code below:
$version = $woothemes_sensei->version;
$version = Sensei()->version
This has not yet been applied across the whole code base but all instances of global $woothemes_sensei will be replaced by it as we continue to improve Sensei.
Get all courses
You can now get all course with this function: WooThemes_Sensei_Courses::get_all_courses(). No need to roll your own WP_Query. This function also comes with a new filter for further extensions: sensei_get_all_courses .
There is a new template for modules which is now included as part of the Sensei templates. You will find it here:
New classes and class name formats
You will notice 2 new classes namely:
- class-sensei-modules.php ( modules functionality )
- class-sensei-teacher.php ( teacher role functionality )
You will also notice that these classes are named differently in that we have dropped WooThemes from the name. The reason for this is to simplify finding files in the class list. The aim is to eventually just end up with class-module and class teacher. This will go hand in hand with using Name spaces when the minimum requirement for WordPress is pushed up to 5.4 and beyond.
When name spaces are supported we will be giving classes simpler names within the Sensei name space, but more on that in future.
More unit tests
The units have been extended, but this is just the beginning as we aim to cover most of the code base with Unit tests. Our tests run publicly here: https://travis-ci.org/woothemes/sensei
Check if admin user is a teacher
We also have a new function to test if the current user is on the admin of the site and if they are a teacher:
You can see the full commit history for this release here: https://github.com/woothemes/sensei/pull/855
See the changelog for full details of this release.
(Comments are closed on this post. If you experience any issues, please contact support via the link in the sidebar.)