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

Use WP checked instead of DRA_get_route_checked_prop #14

Closed tangrufus closed 7 years ago

tangrufus commented 7 years ago

Future proof by using Wordpress' checked over DRA_get_route_checked_prop

https://github.com/dmchale/disable-json-api/blob/a4f8cc57ca0558a0d5f9da8862e14e677076712a/admin.php#L91

dmchale commented 7 years ago

checked() only supports string comparisons, though ... DRA_get_route_checked_prop() uses in_array() to find a match.

I'm fine updating the return to checked='checked' instead of the lazy attribute-only value that it is now, but I don't think using checked() actually helps here.

dmchale commented 7 years ago

Updated return value. Going to consider this all set for now : https://github.com/dmchale/disable-json-api/commit/b843bcb1b4b2cb54ab07d696a29ddc887a2c9044