dmchale / disable-json-api

Public repo for the "Disable REST API" WordPress plugin, currently with 90,000+ active installs in the wordpress.org repository
10 stars 9 forks source link

Unnecessary `$dra_object` #8

Closed tangrufus closed 7 years ago

tangrufus commented 7 years ago

Keeping $dra_object is unnecessary, though i think moving add_filter out of Disable_REST_API class is better OOP design.

https://github.com/dmchale/disable-json-api/blob/f907172e83021f622b3007ef363bc5fa6c610cdc/disable-json-api.php#L21

Furthermore, admin page should have its own class.

dmchale commented 7 years ago

agreed it's not needed: https://github.com/dmchale/disable-json-api/commit/c76e16649b5ac1722f5941f4da3b692ab1feceac

Happy to chat more about moving add_filter out, though in this specific context discussing pure OOP is probably irrelevant since this isn't a use-case where this object is ever meant to be instantiated more than once :)