New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add "sensei" CSS class to all Sensei LMS pages #3275
Add "sensei" CSS class to all Sensei LMS pages #3275
Conversation
As a result the sensei body class will automatically be added to: 1. Course results pages 2. Learners profiles 3. Teacher archive pages
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should move the new helper functions to the Sensei_Utils
class to keep them out of the global namespace.
Also, the modules page is still missing the sensei
CSS class.
Instead of having separate
|
@donnapep You just found a bug in version 3.1.1. It is not caused by this PR. When I open a module page I get two errors:
Looking at what happens there it gets the term and tries to get the tax using $term->taxonomy, but that property is not defined so get_taxonomy( $term->taxonomy ) returns false instead of a taxonomy object causing these notices. I haven't why this error occurs, but it occurs in the released version 3.1.1 too. |
Could this also have something to do with the Genesis framework? I don't recall ever seeing a notice on the module page with any theme I use. Perhaps for the purposes of this PR you could trying testing with a non-Genesis theme to get the modules page working? |
@donnapep No I'm alert on that now. I'm testing with a newly installed unaltered twenty twenty theme at the moment. I tested with previous version and had to go back to version 2.4.0 to get rid of the notices. In version 3.0.0 upwards However when I tried the Storefront theme, since it has theme support by default, I didn't get the notices there. There a WP_Term object is returned by |
OK, I can reproduce with Divi. Regardless though, that's a separate issue that we shouldn't try to fix as part of this PR as PRs should be focused on fixing one thing. |
Actually, looks like there's already an issue for that. For this one, doesn't look like we need to worry about the modules page then. After the requested changes are made, this one will be ready. |
@donnapep I just pushed the update. Should be alright now. Otherwise let me know. |
As a result of this PR the sensei body class will automatically be added to:
Fixes #3193
Changes proposed in this Pull Request
Testing instructions
Impacted pages:
/course/{course-slug}/results/
/learner/{username}/
/author/{author}/