hypothesis/wp-hypothesis

Support custom post types in settings page

Opened this issue · 1 comments

The list of post types which users can enable Hypothesis on is limited to Posts and Pages, with a not-well-documented "hypothesis_supported_posttypes" hook which can be used to override this. This means that custom post types added using tools such as Custom Post Types UI will not appear automatically.

It looks to me like it should be possible for the plugin to enumerate all registered post types automatically using get_post_types.

Context: https://hypothesis.zendesk.com/agent/tickets/1314

@robertknight Hi Robert! I contributed the hypothesis_supported_posttypes hook (to facilitate an integration with https://github.com/pressbooks/pressbooks). I assume that if you switch to get_post_types() you will make this change backwards-compatible (e.g. that hook would still work). There are clear use cases for not including all post types so it would still be good to have access to that filter so that some of the registered post types can be excluded 👍