Repository navigation
feat(academy): show the front-end toolbar to content staff - #1073
Merged
Merged
Conversation
BuddyBoss's toolbar setting for non-admins is off so learners don't see the toolbar, but it also hides it from Content Editors, Reviewers and internal staff, who use it to reach the editor from a lesson. Show it to anyone who can edit LearnDash courses or other people's posts, respecting each user's own toolbar preference.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Content Editors and Reviewers can't see the toolbar on the front end, so they can't jump from a lesson to its editor.
Cause
BuddyBoss decides front-end toolbar visibility with two site-wide settings: one for administrators and one for every other logged-in member. On production, Show the Toolbar for logged-in members (non-admins) is off, which keeps it from learners but also hides it from every non-administrator member of staff.
PublishPress Capabilities can only hide the toolbar per role, and PublishPress Permissions doesn't control it, so neither can switch it on for some roles only.
Change
A new mu-plugin,
cbf-staff-toolbar.php, filtersshow_admin_barat priority 50:edit_coursesoredit_others_posts. On production, that's Administrator, Content Editor, Reviewer, Editor and Revisor.The BuddyBoss setting stays off.
Testing
Tested locally with BuddyBoss's non-admin setting forced off, as on production:
A Content Editor who has turned the toolbar off in their profile still doesn't see it. phpcs passes.