All of the following code snippets can be added to your functions.php file or to a custom plugin in order to remove visual elements from being displayed on the course page.
If you need help with actions, see our Actions Reference Overview for more information.
The LifterLMS Lab: Action Manager allows for removal of these actions (and many more) with a simple interface that requires no code to be written. See Action Manager documentation for more information.
In LifterLMS 3.0 a number of settings which allowed site admins to toggle the display of various elements in older versions of LifterLMS have been replaced with actions which can be “toggled” via code snippets.
Settings are nice from a user experience perspective but they are not nice on the performance side.
As an admin, you likely set and forget these settings. However, every time a student access the course a call to the database is made for each setting there’s a checkbox for. There were almost a dozen settings which means to render a page, almost a dozen calls to the database had to be made. Let’s not even count all the other database calls that are made to render the rest of the page.
So, in LifterLMS 3.0, the admins user experience is inconvenienced in favor of a faster page load for your students.
If you add any of these actions to a theme’s functions.php file you shouldn’t run into any issues, but if you add the code to a custom plugin you may need to add the actions within a function that is called “late” in the request lifecycle.
See the WordPress Action Reference for more information about actions called during a request.
Below is an example of how to remove an action later in the request: