aaroneaton / better-yourls

Source code for the Better YOURLS WordPress plugin
21 stars 6 forks source link

Add basic filter support for post types #9

Closed domsammut closed 8 years ago

domsammut commented 8 years ago

Developer ability to filter what post types Better YOURLS runs on. Defaults to running on all post types. When a post type(s) has been specified via a filter, Better YOURLS will only run on the filtered post types.

domsammut commented 8 years ago

It should be noted that the current implementation requires the filter be added in a plugin and not a theme due to the class construction getting triggered early on by 'plugins_loaded' hook.

To make this filter work when added in a theme, we would need to move it inline instead of in the constructor. Happy to hear thoughts back on which way you think would be better and resupply pull request if changes are needed.

ChrisWiegman commented 8 years ago

Looks good. Thanks! If you would like, add your wp.org username as a contributor and I'll add credit for you there as well.