itmaybejj / editoria11y-wp

WordPress wrapper for Editoria11y
GNU General Public License v2.0
5 stars 1 forks source link

Ability to exclude post types from issue tracker #15

Closed cbirdsong closed 9 months ago

cbirdsong commented 9 months ago

We add a Style Guide custom post type for keeping samples of blocks/patterns/etc for easy testing when we make changes or do updates. It would be nice if these could be excluded from the issue tracker with a hook.

itmaybejj commented 9 months ago

Priority-wise -- I don't see myself getting around to writing custom WP hooks this year.

But there is something built-in you can use -- does your custom post type add any classes on the page? Or--could it? If so, the base library has a function intended for just this sort of situation -- the "Turn off Editoria11y if these elements exist" setting on the module config page accepts any CSS selectors. That selector could appear anywhere in the post type -- a body class or inline.

cbirdsong commented 9 months ago

Oh yeah, that works with the usual single- classes. Only issue is that it then doesn't remove any existing pages from the issue tracker because it doesn't load on the page anymore, but if I instead do .single-posttype * in the "Do not flag these elements" box then it clears them out on page load.

itmaybejj commented 9 months ago

Oh clever; I hadn't thought to use that in that way.