Description
This filter allows you to change who can see the Front-end Highlighter Widget and explore issues on the page directly. The default value is false meaning the highlighter will be visible to users that have the edit_post capability only. Using the filter, you can perform custom permission checks.
Usage
add_filter( 'edac_filter_frontend_highlighter_visibility', 'custom_highlighter_view_function' );
Examples
Show front-end highlighter to logged out users
The following example shows how to allow all visitors (even unauthenticated users) to see the accessibility-checker issues in the frontend highlighter. This might be useful is you’re a theme developer and want to show Accessibility Checker reports on your theme demo to logged out users.
Show front-end highlighter to logged in users of any role
This example shows how you can make the highlighter visible to all logged in users. You could edit this to perform your own custom capability checks.
Since
This filter was added in Accessibility Checker 1.14.0.
Source Code
This filter is located in init_hooks()
in /admin/class-frontend-highlight.php
and maybe_enqueue_frontend_highlighter()
in includes/classes/class-enqueue-frontend.php