equalizedigital / accessibility-checker

GNU General Public License v2.0
15 stars 8 forks source link

Add filter to allow frontend highlighter to be shown to other users #670

Closed pattonwebz closed 1 week ago

pattonwebz commented 3 weeks ago

This PR adds a filter (used in 2 places) that will allow a site owner to choose to output the frontend highlighter to people, even those without edit_post permissions on the currently viewed post.

TODO: update the since tag in the filter docs if we schedule this to go out in a specific release.

Usage example:

/*
 * Returning True allows the current visitor to see the highlighter.
 *
 * Default value is false. You can use a function instead to perform
 * more fine-grained checks as per your needs.
 */
add_filter('edac_filter_frontend_highlighter_visibility', '__return_true');

Closes: #669